Skip to content

Commit

Permalink
0.1.2
Browse files Browse the repository at this point in the history
- Tweaks to merge command and merged-xml output

Signed-off-by: Matthew Ballance <[email protected]>
  • Loading branch information
mballance committed Jul 17, 2022
1 parent 240f934 commit 2bc9afd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

## 0.1.2
- Tweaks to merge command and merged-xml output

## 0.1.1
- Tweaks to text reporting

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion src/ucis/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/ucis/cmd/cmd_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ def merge(args):
for db in db_l:
db.close()



31 changes: 31 additions & 0 deletions src/ucis/xml/xml_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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

Expand Down

0 comments on commit 2bc9afd

Please sign in to comment.