55 discover: bool # auto discovery flag |
55 discover: bool # auto discovery flag |
56 discoveryStart: str # start directory for auto discovery |
56 discoveryStart: str # start directory for auto discovery |
57 testFilename: str # name of the test script |
57 testFilename: str # name of the test script |
58 testName: str # name of the test function |
58 testName: str # name of the test function |
59 failFast: bool # stop on first fail |
59 failFast: bool # stop on first fail |
|
60 failedOnly: bool # run failed tests only |
60 collectCoverage: bool # coverage collection flag |
61 collectCoverage: bool # coverage collection flag |
61 eraseCoverage: bool # erase coverage data first |
62 eraseCoverage: bool # erase coverage data first |
62 |
63 |
63 |
64 |
64 class UTExecutorBase(QObject): |
65 class UTExecutorBase(QObject): |
75 Tuple elements are test id, test name and short description. |
76 Tuple elements are test id, test name and short description. |
76 @signal testResult(UTTestResult) emitted when a test result is ready |
77 @signal testResult(UTTestResult) emitted when a test result is ready |
77 @signal testFinished(list, str) emitted when the test has finished. |
78 @signal testFinished(list, str) emitted when the test has finished. |
78 The elements are the list of test results and the captured output |
79 The elements are the list of test results and the captured output |
79 of the test worker (if any). |
80 of the test worker (if any). |
|
81 @signal testRunAboutToBeStarted() emitted just before the test run will |
|
82 be started. |
80 @signal testRunFinished(int, float) emitted when the test run has finished. |
83 @signal testRunFinished(int, float) emitted when the test run has finished. |
81 The elements are the number of tests run and the duration in seconds |
84 The elements are the number of tests run and the duration in seconds |
82 @signal stop() emitted when the test process is being stopped. |
85 @signal stop() emitted when the test process is being stopped. |
83 @signal coverageDataSaved(str) emitted after the coverage data was saved. |
86 @signal coverageDataSaved(str) emitted after the coverage data was saved. |
84 The element is the absolute path of the coverage data file. |
87 The element is the absolute path of the coverage data file. |
86 collected = pyqtSignal(list) |
89 collected = pyqtSignal(list) |
87 collectError = pyqtSignal(list) |
90 collectError = pyqtSignal(list) |
88 startTest = pyqtSignal(tuple) |
91 startTest = pyqtSignal(tuple) |
89 testResult = pyqtSignal(UTTestResult) |
92 testResult = pyqtSignal(UTTestResult) |
90 testFinished = pyqtSignal(list, str) |
93 testFinished = pyqtSignal(list, str) |
|
94 testRunAboutToBeStarted = pyqtSignal() |
91 testRunFinished = pyqtSignal(int, float) |
95 testRunFinished = pyqtSignal(int, float) |
92 stop = pyqtSignal() |
96 stop = pyqtSignal() |
93 coverageDataSaved = pyqtSignal(str) |
97 coverageDataSaved = pyqtSignal(str) |
94 |
98 |
95 module = "" |
99 module = "" |
202 if config.discover else |
206 if config.discover else |
203 os.path.dirname(config.testFilename) |
207 os.path.dirname(config.testFilename) |
204 ) |
208 ) |
205 self.__process = self._prepareProcess(workDir, pythonpath) |
209 self.__process = self._prepareProcess(workDir, pythonpath) |
206 testArgs = self.createArguments(config) |
210 testArgs = self.createArguments(config) |
|
211 self.testRunAboutToBeStarted.emit() |
207 self.__process.start(config.interpreter, testArgs) |
212 self.__process.start(config.interpreter, testArgs) |
208 running = self.__process.waitForStarted() |
213 running = self.__process.waitForStarted() |
209 if not running: |
214 if not running: |
210 raise RuntimeError |
215 raise RuntimeError |
211 |
216 |