diff --git a/doc/Changelog.md b/doc/Changelog.md index 6aec8b0..56a2092 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -1,4 +1,7 @@ +## 0.1.2 +- Tweaks to merge command and merged-xml output + ## 0.1.1 - Tweaks to text reporting diff --git a/setup.py b/setup.py index 67e37a7..2c1b58d 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os from setuptools import setup, find_namespace_packages -version="0.1.1" +version="0.1.2" if "BUILD_NUM" in os.environ.keys(): version = version + "." + os.environ["BUILD_NUM"] diff --git a/src/ucis/__main__.py b/src/ucis/__main__.py index 984d371..a87ca6a 100644 --- a/src/ucis/__main__.py +++ b/src/ucis/__main__.py @@ -44,7 +44,7 @@ def get_parser(): help="Specifies the format of the input databases. Defaults to 'xml'") merge.add_argument("--libucis", "-l", help="Specifies the name/path of the UCIS shared library") - merge.add_argument("db", action="append") + merge.add_argument("db", nargs="+") merge.set_defaults(func=cmd_merge.merge) list_db_formats = subparser.add_parser("list-db-formats", diff --git a/src/ucis/cmd/cmd_merge.py b/src/ucis/cmd/cmd_merge.py index a8a48c5..5504d16 100644 --- a/src/ucis/cmd/cmd_merge.py +++ b/src/ucis/cmd/cmd_merge.py @@ -50,4 +50,4 @@ def merge(args): for db in db_l: db.close() - \ No newline at end of file + diff --git a/src/ucis/xml/xml_writer.py b/src/ucis/xml/xml_writer.py index 4c3d3df..2877abb 100644 --- a/src/ucis/xml/xml_writer.py +++ b/src/ucis/xml/xml_writer.py @@ -98,9 +98,11 @@ def write_history_nodes(self): # histNodes = self.root.SubElement(self.root, "historyNodes") + have_hist_nodes = False for i,h in enumerate(self.db.getHistoryNodes(HistoryNodeKind.ALL)): histN = self.mkElem(self.root, "historyNodes") histN.set("historyNodeId", str(i)) + have_hist_nodes = True # TODO: parent histN.set("logicalName", h.getLogicalName()) @@ -125,6 +127,35 @@ def write_history_nodes(self): self.setAttr(histN, "vendorToolVersion", h.getVendorToolVersion()) self.setIfNonNeg(histN, "sameTests", h.getSameTests()) self.setIfNonNull(histN, "comment", h.getComment()) + + if not have_hist_nodes: + # XML requires history nodes, so add a dummy history node + histN = self.mkElem(self.root, "historyNodes") + histN.set("historyNodeId", str(0)) + + histN.set("logicalName", "dummy") + self.setIfNonNull(histN, "physicalName", "dummy") + self.setIfNonNull(histN, "kind", "dummy") + self.setAttrBool(histN, "testStatus", True) + self.setIfNonNeg(histN, "simtime", 0) + self.setIfNonNull(histN, "timeunit", 0) + self.setIfNonNull(histN, "runCwd", "") + self.setIfNonNeg(histN, "cpuTime", 0) + self.setIfNonNull(histN, "seed", 0) + self.setIfNonNull(histN, "cmd", "") + self.setIfNonNull(histN, "args", "") +# self.setIfNonNull(histN, "compulsory", h.getCompulsory()) + self.setAttrDateTime(histN, "date", datetime.now().strftime("%Y%m%d%H%M%S")) + self.setIfNonNull(histN, "userName", "dummy") +# self.setIfNonNeg(histN, "cost", h.getCost()) + self.setAttr(histN, "toolCategory", "unknown") + self.setAttr(histN, "ucisVersion", "1.0") + self.setAttr(histN, "vendorId", "unknown") + self.setAttr(histN, "vendorTool", "PyUCIS") + self.setAttr(histN, "vendorToolVersion", "unknown") +# self.setIfNonNeg(histN, "sameTests", h.getSameTests()) +# self.setIfNonNull(histN, "comment", h.getComment()) + # TODO: userAttr