Changeset 144fe21 in sasview for src/sas/qtgui/GUITests.py
- Timestamp:
- Jul 26, 2018 3:30:15 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- dc71408
- Parents:
- e793f62
- git-author:
- Piotr Rozyczko <rozyczko@…> (07/26/18 03:28:51)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (07/26/18 03:30:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GUITests.py
rd0528c4 r144fe21 11 11 by running ``python setup.py install`` in both repositories. 12 12 13 The tests can be run with ``python GUITests.py``, or to get more verbose 14 console output (recommended), use ``python GUITests.py -v``. 13 The tests can be run with ``python GUITests.py``, or 14 ``python GUITests.py suiteName1 suiteName2 ...`` for a subset of tests. 15 16 To get more verbose console output (recommended), use ``python GUITests.py -v`` 17 or modify tge VERBOSITY module variable. 15 18 """ 19 20 # Llist of all suite names. Every time a new suite is added, its name should 21 # also be added here 22 ALL_SUITES = [ 23 'calculatorsSuite', 24 'mainSuite', 25 'fittingSuite', 26 'plottingSuite', 27 'utilitiesSuite', 28 'perspectivesSuite', 29 ] 30 31 # Define output verbosity 32 #VERBOSITY = 0 # quiet - just the total number of tests run and global result 33 VERBOSITY = 1 # default - quiet + a dot for every successful test or a F for failure 34 #VERBOSITY = 2 # verbose - default + help string of every test and the result 16 35 17 36 # Prepare the general QApplication instance … … 83 102 from Perspectives.Inversion.UnitTesting import InversionPerspectiveTest 84 103 85 def suite():104 def plottingSuite(): 86 105 suites = ( 87 106 # Plotting … … 101 120 unittest.makeSuite(PlotterBaseTest.PlotterBaseTest, 'test'), 102 121 unittest.makeSuite(PlotterTest.PlotterTest, 'test'), 103 122 ) 123 return unittest.TestSuite(suites) 124 125 def mainSuite(): 126 suites = ( 104 127 # Main window 105 128 unittest.makeSuite(DataExplorerTest.DataExplorerTest, 'test'), … … 109 132 unittest.makeSuite(AboutBoxTest.AboutBoxTest, 'test'), 110 133 unittest.makeSuite(WelcomePanelTest.WelcomePanelTest, 'test'), 111 112 # Utilities 134 ) 135 return unittest.TestSuite(suites) 136 137 def utilitiesSuite(): 138 suites = ( 139 ## Utilities 113 140 unittest.makeSuite(TestUtilsTest.TestUtilsTest, 'test'), 114 141 unittest.makeSuite(SasviewLoggerTest.SasviewLoggerTest, 'test'), … … 122 149 unittest.makeSuite(AddMultEditorTest.AddMultEditorTest, 'test'), 123 150 unittest.makeSuite(ReportDialogTest.ReportDialogTest, 'test'), 124 151 ) 152 return unittest.TestSuite(suites) 153 154 def calculatorsSuite(): 155 suites = ( 125 156 # Calculators 126 157 unittest.makeSuite(KiessigCalculatorTest.KiessigCalculatorTest, 'test'), … … 131 162 unittest.makeSuite(ResolutionCalculatorPanelTest.ResolutionCalculatorPanelTest, 'test'), 132 163 unittest.makeSuite(DataOperationUtilityTest.DataOperationUtilityTest, 'test'), 133 164 ) 165 return unittest.TestSuite(suites) 166 167 def fittingSuite(): 168 suites = ( 134 169 # Perspectives 135 170 # Fitting … … 143 178 unittest.makeSuite(ConstraintWidgetTest.ConstraintWidgetTest, 'test'), 144 179 unittest.makeSuite(ComplexConstraintTest.ComplexConstraintTest, 'test'), 145 180 ) 181 return unittest.TestSuite(suites) 182 183 def perspectivesSuite(): 184 suites = ( 146 185 # Invariant 147 186 unittest.makeSuite(InvariantPerspectiveTest.InvariantPerspectiveTest, 'test'), 148 187 # Inversion 149 unittest.makeSuite(InversionPerspectiveTest.InversionTest, 'test'),188 #unittest.makeSuite(InversionPerspectiveTest.InversionTest, 'test'), 150 189 ) 151 190 return unittest.TestSuite(suites) 152 191 153 192 if __name__ == "__main__": 154 unittest.main(defaultTest="suite") 155 193 194 user_suites = ALL_SUITES 195 # Check if user asked for specific suites: 196 if len(sys.argv) > 1: 197 user_suites = sys.argv[1:] 198 199 runner = unittest.TextTestRunner(verbosity=VERBOSITY) 200 for suite in user_suites: 201 # create the suite object from name 202 try: 203 suite_instance = globals()[suite]() 204 results = runner.run(suite_instance) 205 except KeyError: 206 print("ERROR: Incorrect suite name: %s " % suite) 207 pass
Note: See TracChangeset
for help on using the changeset viewer.