diff --git a/src/Mod/Test/CMakeLists.txt b/src/Mod/Test/CMakeLists.txt index b4d101a0b8e7..5fc8d5f7c517 100644 --- a/src/Mod/Test/CMakeLists.txt +++ b/src/Mod/Test/CMakeLists.txt @@ -15,6 +15,7 @@ SET(Test_SRCS unittestgui.py testmakeWireString.py TestPythonSyntax.py + TestPerf.py ) SET(TestData_SRCS diff --git a/src/Mod/Test/TestPerf.py b/src/Mod/Test/TestPerf.py index 954ff3d40bdf..98855047166f 100644 --- a/src/Mod/Test/TestPerf.py +++ b/src/Mod/Test/TestPerf.py @@ -58,6 +58,11 @@ def setUp(self): self.fileList = sys.argv[sys.argv.index("--pass") + 1 :] else: 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 == "": self.tnp = "" else: @@ -91,6 +96,9 @@ def testAll(self): dumpdata = hpy().heap() dumpdata.stat.dump(self.memfile) self.memfile.flush() + if self.saveModels: + filenametnp = App.ActiveDocument.Name + self.tnp + App.ActiveDocument.saveAs(filenametnp) App.closeDocument(doc.Name) try: diff --git a/tools/profile/perftest.sh b/tools/profile/perftest.sh index 952d818c0208..018c04a4b10d 100755 --- a/tools/profile/perftest.sh +++ b/tools/profile/perftest.sh @@ -7,9 +7,10 @@ notnp= #/bin/FreeCAD${cmd} tnp= #