From: jh777916 Date: Fri, 6 Oct 2023 11:57:16 +0000 (+0200) Subject: Updating the tests : reconstruction of the baselines; modification of the CMakeLists... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=886fd049bef512403f25f783586e2484576a2e00;p=modules%2Fgui.git Updating the tests : reconstruction of the baselines; modification of the CMakeLists to avoid the installation of unneeded files; fixing PlotTestBase.py and plot_test.py since QApplication usage was kind of buggy; correction of what looked like a mistake in test testSetCurrentCurve2; update of testDeleteCallBack since it was using an inadequate crvId --- diff --git a/tools/CurvePlot/src/python/test/CMakeLists.txt b/tools/CurvePlot/src/python/test/CMakeLists.txt index fd4c59f81..a001435d4 100644 --- a/tools/CurvePlot/src/python/test/CMakeLists.txt +++ b/tools/CurvePlot/src/python/test/CMakeLists.txt @@ -22,7 +22,6 @@ SALOME_CONFIGURE_FILE(SalomePyQt_MockUp.py.in mockup/SalomePyQt_MockUp.py) SET(_all_SCRIPTS PlotCurve_Standalone.py - plot_test.py TestDesktop.py ) @@ -33,18 +32,16 @@ SET(_test_SCRIPTS ) SALOME_INSTALL_SCRIPTS("${_all_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON}/tests) +# Needed for the PlotCurve_standalone.py script SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/mockup/SalomePyQt_MockUp.py ${SALOME_INSTALL_SCRIPT_PYTHON}/tests) SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/mockup/SalomePyQt_MockUp.py ${SALOME_CURVEPLOT_INSTALL_PYTHON}) - -INSTALL(DIRECTORY baselines DESTINATION ${SALOME_INSTALL_SCRIPT_PYTHON}/tests) - +# For test purposes SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${CMAKE_BINARY_DIR}/local) # point to local curveplot package in BUILD dir SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) -#ADD_TEST(CurvePlotUnitTests ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/plot_test.py) -#SET_TESTS_PROPERTIES(CurvePlotUnitTests PROPERTIES ENVIRONMENT "${tests_env}") +ADD_TEST(CurvePlotUnitTests ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/plot_test.py) +SET_TESTS_PROPERTIES(CurvePlotUnitTests PROPERTIES ENVIRONMENT "${tests_env}") -# For test purposes FILE(COPY ${_test_SCRIPTS} DESTINATION ${CRVPLOT_TEST_INSTALL}) FILE(COPY baselines DESTINATION ${CRVPLOT_TEST_INSTALL}) diff --git a/tools/CurvePlot/src/python/test/PlotTestBase.py b/tools/CurvePlot/src/python/test/PlotTestBase.py index 77bdf3439..f8d854f2f 100644 --- a/tools/CurvePlot/src/python/test/PlotTestBase.py +++ b/tools/CurvePlot/src/python/test/PlotTestBase.py @@ -95,14 +95,17 @@ class PlotTestBase(unittest.TestCase): self.tmpDir = None # Minimal UI setup: - self.app = QApplication(sys.argv) - desktop = TestDesktop(None) - self.sgPyQt = SalomePyQt(desktop) - desktop._sgPyQt = self.sgPyQt - desktop.initialize() + self.app = QApplication.instance() + if self.app is None: + self.app = QApplication(sys.argv) + + self.desktop = TestDesktop(None) + self.sgPyQt = SalomePyQt(self.desktop) + self.desktop._sgPyQt = self.sgPyQt + self.desktop.initialize() self.plotController = PlotController.GetInstance(self.sgPyQt) - desktop.resize(800, 600) - desktop.show() + self.desktop.resize(800, 600) + self.desktop.show() self._execQtWasCalled = False # Used to automatically finish Qt execution loop on tests not doing a screenshot # Reset some class var to make sure IDs appearing in screenshots do not depend on test seq order: @@ -130,8 +133,8 @@ class PlotTestBase(unittest.TestCase): def _execQt(self, withShot=False): if withShot: QTimer.singleShot(50, self._shotEvent) # take picture - QTimer.singleShot(200, self.app.quit) # quit - self.app.exec_() # will hang till quit is fired + QTimer.singleShot(200, self._appQuit) # quit + self.app.exit(self.app.exec()) # will hang till quit is fired # Important make sure previous app is properly killed before launching next test! # Qt doesn't like multiple running instance @@ -146,6 +149,10 @@ class PlotTestBase(unittest.TestCase): self._execQt(withShot=True) return self.retValue + def _appQuit(self): + self.desktop.destroy() + self.app.quit() + def _shotEvent(self): self.retValue = self._snapAndCompare(self.saveW) @@ -160,7 +167,7 @@ class PlotTestBase(unittest.TestCase): self.qpixmap = QPixmap(widget.size()) widget.repaint() widget.render(self.qpixmap) - #self.qpixmap = widget.grab() + self.qpixmap = widget.grab() # Nothing to compare if rebuilding base lines, just saving file: if self.REBUILD_BASELINES: @@ -169,8 +176,9 @@ class PlotTestBase(unittest.TestCase): gen_path = self.saveCurrentPix(self.tmpDir, suffix) base_ref = os.path.join(self._this_dir, self.__BASE_LINE_DIR, self.getTestName() + suffix) + ret = False - for ref_path in glob.glob("%s_*.%s" % (base_ref, self.__FORMAT)): + for ref_path in glob.glob("%s.%s" % (base_ref, self.__FORMAT)): try: ret = filecmp.cmp(ref_path, gen_path, shallow=False) if ret: diff --git a/tools/CurvePlot/src/python/test/baselines/testAddCurve.png b/tools/CurvePlot/src/python/test/baselines/testAddCurve.png new file mode 100644 index 000000000..bf294674f Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testAddCurve.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testAddCurveAppend.png b/tools/CurvePlot/src/python/test/baselines/testAddCurveAppend.png new file mode 100644 index 000000000..325d49810 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testAddCurveAppend.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testAddCurveAppend_a.png b/tools/CurvePlot/src/python/test/baselines/testAddCurveAppend_a.png deleted file mode 100644 index 0f251a065..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testAddCurveAppend_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testAddCurve_a.png b/tools/CurvePlot/src/python/test/baselines/testAddCurve_a.png deleted file mode 100644 index 79645403b..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testAddCurve_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testAddPlotSet.png b/tools/CurvePlot/src/python/test/baselines/testAddPlotSet.png new file mode 100644 index 000000000..6869612f8 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testAddPlotSet.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testAddPlotSet_a.png b/tools/CurvePlot/src/python/test/baselines/testAddPlotSet_a.png deleted file mode 100644 index 6667d06d7..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testAddPlotSet_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testClearPlotSet.png b/tools/CurvePlot/src/python/test/baselines/testClearPlotSet.png new file mode 100644 index 000000000..3222427bb Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testClearPlotSet.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testClearPlotSet2.png b/tools/CurvePlot/src/python/test/baselines/testClearPlotSet2.png new file mode 100644 index 000000000..6869612f8 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testClearPlotSet2.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testClearPlotSet2_a.png b/tools/CurvePlot/src/python/test/baselines/testClearPlotSet2_a.png deleted file mode 100644 index 6667d06d7..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testClearPlotSet2_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testClearPlotSet_a.png b/tools/CurvePlot/src/python/test/baselines/testClearPlotSet_a.png deleted file mode 100644 index 7e2f7abe3..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testClearPlotSet_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testCopyCurve.png b/tools/CurvePlot/src/python/test/baselines/testCopyCurve.png new file mode 100644 index 000000000..514d3b323 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testCopyCurve.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testCopyCurve_a.png b/tools/CurvePlot/src/python/test/baselines/testCopyCurve_a.png deleted file mode 100644 index be7e36eab..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testCopyCurve_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_curve.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_curve.png new file mode 100644 index 000000000..cad5c6413 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_curve.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_curve_a.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_curve_a.png deleted file mode 100644 index c896b6f07..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_curve_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_plotSet.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_plotSet.png new file mode 100644 index 000000000..aece21d04 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_plotSet.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_plotSet_a.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_plotSet_a.png deleted file mode 100644 index 43858fff8..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeleteCurrentItem_plotSet_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve1.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve1.png new file mode 100644 index 000000000..7e7d8b87d Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve1.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve1_a.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve1_a.png deleted file mode 100644 index 744a6f5cc..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve1_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve2.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve2.png new file mode 100644 index 000000000..b184a7a92 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve2.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve2_a.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve2_a.png deleted file mode 100644 index 744a6f5cc..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve2_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve3.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve3.png new file mode 100644 index 000000000..687d0ce32 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve3.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve3_a.png b/tools/CurvePlot/src/python/test/baselines/testDeleteCurve3_a.png deleted file mode 100644 index 45ec73a43..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeleteCurve3_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet1.png b/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet1.png new file mode 100644 index 000000000..3eba5c333 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet1.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet1_a.png b/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet1_a.png deleted file mode 100644 index 0d80b2384..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet1_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet2.png b/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet2.png new file mode 100644 index 000000000..3eba5c333 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet2.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet2_a.png b/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet2_a.png deleted file mode 100644 index 0d80b2384..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testDeletePlotSet2_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testExtendCurve.png b/tools/CurvePlot/src/python/test/baselines/testExtendCurve.png new file mode 100644 index 000000000..3baf88b13 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testExtendCurve.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testExtendCurve_a.png b/tools/CurvePlot/src/python/test/baselines/testExtendCurve_a.png deleted file mode 100644 index ad04b34c2..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testExtendCurve_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testLockRepaint.png b/tools/CurvePlot/src/python/test/baselines/testLockRepaint.png new file mode 100644 index 000000000..7349cb4a2 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testLockRepaint.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testLockRepaint_a.png b/tools/CurvePlot/src/python/test/baselines/testLockRepaint_a.png deleted file mode 100644 index 58fa9fcd9..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testLockRepaint_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testPlotCurveFromTable.png b/tools/CurvePlot/src/python/test/baselines/testPlotCurveFromTable.png new file mode 100644 index 000000000..77776e3e1 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testPlotCurveFromTable.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testPlotCurveFromTable_a.png b/tools/CurvePlot/src/python/test/baselines/testPlotCurveFromTable_a.png deleted file mode 100644 index 4ac74a111..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testPlotCurveFromTable_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testResetCurve.png b/tools/CurvePlot/src/python/test/baselines/testResetCurve.png new file mode 100644 index 000000000..a590a7501 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testResetCurve.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testResetCurve_a.png b/tools/CurvePlot/src/python/test/baselines/testResetCurve_a.png deleted file mode 100644 index 2c1a0c30f..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testResetCurve_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve.png new file mode 100644 index 000000000..1f3f9c3ed Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve2.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve2.png new file mode 100644 index 000000000..6b3c55f0e Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve2.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve2_a.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve2_a.png deleted file mode 100644 index 94d929b54..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve2_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve3.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve3.png new file mode 100644 index 000000000..72af0566c Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve3.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve3_a.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve3_a.png deleted file mode 100644 index c896b6f07..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve3_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve_a.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve_a.png deleted file mode 100644 index bfb41d673..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetCurrentCurve_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentPlotSet.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentPlotSet.png new file mode 100644 index 000000000..0afdf3f45 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetCurrentPlotSet.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurrentPlotSet_a.png b/tools/CurvePlot/src/python/test/baselines/testSetCurrentPlotSet_a.png deleted file mode 100644 index 7b2ca2a0a..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetCurrentPlotSet_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurveLabel.png b/tools/CurvePlot/src/python/test/baselines/testSetCurveLabel.png new file mode 100644 index 000000000..5c5674280 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetCurveLabel.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurveLabel_a.png b/tools/CurvePlot/src/python/test/baselines/testSetCurveLabel_a.png deleted file mode 100644 index 0ae41d138..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetCurveLabel_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurveMarker.png b/tools/CurvePlot/src/python/test/baselines/testSetCurveMarker.png new file mode 100644 index 000000000..7edd9525f Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetCurveMarker.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetCurveMarker_a.png b/tools/CurvePlot/src/python/test/baselines/testSetCurveMarker_a.png deleted file mode 100644 index a126ef86a..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetCurveMarker_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetLabelX.png b/tools/CurvePlot/src/python/test/baselines/testSetLabelX.png new file mode 100644 index 000000000..492453e0c Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetLabelX.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetLabelX_a.png b/tools/CurvePlot/src/python/test/baselines/testSetLabelX_a.png deleted file mode 100644 index 08537dbf1..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetLabelX_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetLabelY.png b/tools/CurvePlot/src/python/test/baselines/testSetLabelY.png new file mode 100644 index 000000000..7c266a7db Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetLabelY.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetLabelY_a.png b/tools/CurvePlot/src/python/test/baselines/testSetLabelY_a.png deleted file mode 100644 index d917195d8..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetLabelY_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetLegendVisible.png b/tools/CurvePlot/src/python/test/baselines/testSetLegendVisible.png new file mode 100644 index 000000000..1d97b6e4b Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetLegendVisible.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetLegendVisible_a.png b/tools/CurvePlot/src/python/test/baselines/testSetLegendVisible_a.png deleted file mode 100644 index 55e35a945..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetLegendVisible_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetPlotSetTitle.png b/tools/CurvePlot/src/python/test/baselines/testSetPlotSetTitle.png new file mode 100644 index 000000000..b839d05fc Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetPlotSetTitle.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetPlotSetTitle_a.png b/tools/CurvePlot/src/python/test/baselines/testSetPlotSetTitle_a.png deleted file mode 100644 index 6920c0117..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetPlotSetTitle_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetXSciNotation.png b/tools/CurvePlot/src/python/test/baselines/testSetXSciNotation.png new file mode 100644 index 000000000..0c4ef0541 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetXSciNotation.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetXSciNotation_a.png b/tools/CurvePlot/src/python/test/baselines/testSetXSciNotation_a.png deleted file mode 100644 index 649579cd7..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetXSciNotation_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetYSciNotation.png b/tools/CurvePlot/src/python/test/baselines/testSetYSciNotation.png new file mode 100644 index 000000000..27860e961 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSetYSciNotation.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSetYSciNotation_a.png b/tools/CurvePlot/src/python/test/baselines/testSetYSciNotation_a.png deleted file mode 100644 index 3dc38aa60..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSetYSciNotation_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSettingsCurveColor.png b/tools/CurvePlot/src/python/test/baselines/testSettingsCurveColor.png new file mode 100644 index 000000000..9694c4654 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSettingsCurveColor.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSettingsCurveColor_a.png b/tools/CurvePlot/src/python/test/baselines/testSettingsCurveColor_a.png deleted file mode 100644 index bdf2ac5b0..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSettingsCurveColor_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSettingsCurveMarker.png b/tools/CurvePlot/src/python/test/baselines/testSettingsCurveMarker.png new file mode 100644 index 000000000..32d57616f Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testSettingsCurveMarker.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testSettingsCurveMarker_a.png b/tools/CurvePlot/src/python/test/baselines/testSettingsCurveMarker_a.png deleted file mode 100644 index a5f8fe88f..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testSettingsCurveMarker_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testToggleXLog.png b/tools/CurvePlot/src/python/test/baselines/testToggleXLog.png new file mode 100644 index 000000000..83a71d67b Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testToggleXLog.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testToggleXLog_a.png b/tools/CurvePlot/src/python/test/baselines/testToggleXLog_a.png deleted file mode 100644 index 96319afe4..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testToggleXLog_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/baselines/testToggleYLog.png b/tools/CurvePlot/src/python/test/baselines/testToggleYLog.png new file mode 100644 index 000000000..7a13bdd61 Binary files /dev/null and b/tools/CurvePlot/src/python/test/baselines/testToggleYLog.png differ diff --git a/tools/CurvePlot/src/python/test/baselines/testToggleYLog_a.png b/tools/CurvePlot/src/python/test/baselines/testToggleYLog_a.png deleted file mode 100644 index cdfe1e728..000000000 Binary files a/tools/CurvePlot/src/python/test/baselines/testToggleYLog_a.png and /dev/null differ diff --git a/tools/CurvePlot/src/python/test/plot_test.py b/tools/CurvePlot/src/python/test/plot_test.py index a8bf16f00..34b79311e 100644 --- a/tools/CurvePlot/src/python/test/plot_test.py +++ b/tools/CurvePlot/src/python/test/plot_test.py @@ -20,12 +20,11 @@ # Author : A. Bruneton # from curveplot import * -from curveplot.PlotTestBase import PlotTestBase, processDecorator +from curveplot.PlotTestBase import PlotTestBase, processDecorator, runOnly from curveplot.PlotSettings import PlotSettings from pyqtside.QtWidgets import QApplication import sys -qapp = QApplication(sys.argv) class PlotTest(PlotTestBase): """ Unit test suite for the curve plotter. The tests themselves are stored in this class, @@ -140,6 +139,8 @@ class PlotTest(PlotTestBase): # # GUI tests # + # + def testAddCurve(self): x, y = self.generateSine() tw = self.showTabWidget() @@ -273,7 +274,7 @@ class PlotTest(PlotTestBase): x, y = self.generateSine() crvID, psID = PlotController.AddCurve(x, y, append=False) PlotController.SetCurrentCurve(crvID) - _, crvID2 = PlotController.AddCurve(x, y, append=False) # in a new plot set + crvID2, _ = PlotController.AddCurve(x, y, append=False) # in a new plot set PlotController.SetCurrentCurve(crvID2) # on first plot set curve should not be selected anymore PlotController.SetCurrentPlotSet(psID) @@ -444,21 +445,21 @@ class PlotTest(PlotTestBase): x, y = self.generateExp() crvId, _ = PlotController.AddCurve(x, y) PlotController.RegisterCallback(fun) - PlotController.SetCurrentCurve(crvId) + PlotController.SetCurrentCurve(crvId) # callback is be called self.assertEqual(crvId, a_callb) def testDeleteCallback(self): - global a_callb - a_callb = 0 def fun(crv_id): global a_callb - a_callb = crv_id + a_callb = 0 self.showTabWidget() x, y = self.generateExp() crvId, _ = PlotController.AddCurve(x, y) + global a_callb + a_callb = crvId PlotController.RegisterCallback(fun) PlotController.ClearCallbacks() - PlotController.SetCurrentCurve(crvId) + PlotController.SetCurrentCurve(crvId) # callback won't be called _, _ = PlotController.AddCurve(x, y) self.assertEqual(crvId, a_callb) @@ -512,7 +513,7 @@ class PlotTest(PlotTestBase): self.assertEqual(psID0, psID2) l, _ = PlotController.GetAllPlotSets() self.assertEqual(1, len(l)) - + # Even if not in main: processDecorator(__name__)