diff options
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-x | scripts/oe-selftest | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest index a04e9fc96c..fd58a66123 100755 --- a/scripts/oe-selftest +++ b/scripts/oe-selftest | |||
@@ -176,7 +176,7 @@ def main(): | |||
176 | suite = unittest.TestSuite() | 176 | suite = unittest.TestSuite() |
177 | loader = unittest.TestLoader() | 177 | loader = unittest.TestLoader() |
178 | loader.sortTestMethodsUsing = None | 178 | loader.sortTestMethodsUsing = None |
179 | runner = unittest.TextTestRunner(verbosity=2) | 179 | runner = unittest.TextTestRunner(verbosity=2, resultclass=StampedResult) |
180 | # we need to do this here, otherwise just loading the tests | 180 | # we need to do this here, otherwise just loading the tests |
181 | # will take 2 minutes (bitbake -e calls) | 181 | # will take 2 minutes (bitbake -e calls) |
182 | oeSelfTest.testlayer_path = get_test_layer() | 182 | oeSelfTest.testlayer_path = get_test_layer() |
@@ -196,6 +196,17 @@ def main(): | |||
196 | else: | 196 | else: |
197 | return 1 | 197 | return 1 |
198 | 198 | ||
199 | class StampedResult(unittest.TextTestResult): | ||
200 | """ | ||
201 | Custom TestResult that prints the time when a test starts. As oe-selftest | ||
202 | can take a long time (ie a few hours) to run, timestamps help us understand | ||
203 | what tests are taking a long time to execute. | ||
204 | """ | ||
205 | def startTest(self, test): | ||
206 | import time | ||
207 | self.stream.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + " - ") | ||
208 | super(StampedResult, self).startTest(test) | ||
209 | |||
199 | if __name__ == "__main__": | 210 | if __name__ == "__main__": |
200 | try: | 211 | try: |
201 | ret = main() | 212 | ret = main() |