Support saving the tnp recalculated file in profile testing
This commit is contained in:
@@ -15,6 +15,7 @@ SET(Test_SRCS
|
|||||||
unittestgui.py
|
unittestgui.py
|
||||||
testmakeWireString.py
|
testmakeWireString.py
|
||||||
TestPythonSyntax.py
|
TestPythonSyntax.py
|
||||||
|
TestPerf.py
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(TestData_SRCS
|
SET(TestData_SRCS
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ class PerfTestCase(unittest.TestCase):
|
|||||||
self.fileList = sys.argv[sys.argv.index("--pass") + 1 :]
|
self.fileList = sys.argv[sys.argv.index("--pass") + 1 :]
|
||||||
else:
|
else:
|
||||||
raise FileNotFoundError("Must provide filename parameter(s) via --pass")
|
raise FileNotFoundError("Must provide filename parameter(s) via --pass")
|
||||||
|
if "--save" in sys.argv:
|
||||||
|
self.saveModels = True
|
||||||
|
self.fileList = sys.argv[sys.argv.index("--save") + 1 :]
|
||||||
|
else:
|
||||||
|
self.saveModels = False
|
||||||
if Part.Shape().ElementMapVersion == "":
|
if Part.Shape().ElementMapVersion == "":
|
||||||
self.tnp = ""
|
self.tnp = ""
|
||||||
else:
|
else:
|
||||||
@@ -91,6 +96,9 @@ class PerfTestCase(unittest.TestCase):
|
|||||||
dumpdata = hpy().heap()
|
dumpdata = hpy().heap()
|
||||||
dumpdata.stat.dump(self.memfile)
|
dumpdata.stat.dump(self.memfile)
|
||||||
self.memfile.flush()
|
self.memfile.flush()
|
||||||
|
if self.saveModels:
|
||||||
|
filenametnp = App.ActiveDocument.Name + self.tnp
|
||||||
|
App.ActiveDocument.saveAs(filenametnp)
|
||||||
App.closeDocument(doc.Name)
|
App.closeDocument(doc.Name)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -7,9 +7,10 @@
|
|||||||
notnp=<Path to your first executable to profile goes here> #<dir>/bin/FreeCAD${cmd}
|
notnp=<Path to your first executable to profile goes here> #<dir>/bin/FreeCAD${cmd}
|
||||||
tnp=<Path to your second executable to profile goes here> #<dir/bin/FreeCAD${cmd}
|
tnp=<Path to your second executable to profile goes here> #<dir/bin/FreeCAD${cmd}
|
||||||
results="results.txt" # File to append measurements to. We do not clear so xargs works on script
|
results="results.txt" # File to append measurements to. We do not clear so xargs works on script
|
||||||
|
save="--save" # or "" Whether to save the resulting file from the tnp executable for further testing.
|
||||||
|
|
||||||
perf record -o "$1.perf" $notnp -t TestPerf --pass "$@"
|
perf record -o "$1.perf" $notnp -t TestPerf --pass "$@"
|
||||||
perf record -o "$1.tnp.perf" $tnp -t TestPerf --pass "$@"
|
perf record -o "$1.tnp.perf" $tnp -t TestPerf --pass "$save" "$@"
|
||||||
|
|
||||||
# For interactive walking of the details using perf:
|
# For interactive walking of the details using perf:
|
||||||
#perf report -i $1.perf
|
#perf report -i $1.perf
|
||||||
|
|||||||
Reference in New Issue
Block a user