diff options
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index 2c6af351..bbbc23e5 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -275,6 +275,18 @@ process(sys.argv[1]) print "Output: " + output[0] return output[0] + # Tests that the given two paths are identical, modulo path delimiters. E.g. "C:/foo" is equal to "C:\foo". + def assertPathsIdentical(self, path1, path2): + path1 = path1.replace('\\', '/') + path2 = path2.replace('\\', '/') + return self.assertIdentical(path1, path2) + + # Tests that the given two multiline text content are identical, modulo line ending differences (\r\n on Windows, \n on Unix). + def assertTextDataIdentical(self, text1, text2): + text1 = text1.replace('\r\n', '\n') + text2 = text2.replace('\r\n', '\n') + return self.assertIdentical(text1, text2) + def assertIdentical(self, values, y): if type(values) not in [list, tuple]: values = [values] for x in values: @@ -649,6 +661,7 @@ class BrowserCore(RunnerCore): self.reftest(path_from_root('tests', reference)) args = args + ['--pre-js', 'reftest.js', '-s', 'GL_TESTING=1'] Popen([PYTHON, EMCC, temp_filepath, '-o', outfile] + args).communicate() + assert os.path.exists(outfile) if type(expected) is str: expected = [expected] self.run_browser(outfile, message, ['/report_result?' + e for e in expected]) @@ -719,6 +732,7 @@ if __name__ == '__main__': ============================================================================== Running the main part of the test suite. Don't forget to run the other parts! + other - tests separate from the main suite sanity - tests for first run, etc., modifies ~/.emscripten benchmark - run before and after each set of changes before pushing to master, verify no regressions @@ -765,10 +779,17 @@ an individual test with except: pass + numFailures = 0 # Keep count of the total number of failing tests. + # Run the discovered tests if not len(suites): print >> sys.stderr, 'No tests found for %s' % str(sys.argv[1:]) + numFailures = 1 else: testRunner = unittest.TextTestRunner(verbosity=2) for suite in suites: - testRunner.run(suite)
\ No newline at end of file + results = testRunner.run(suite) + numFailures += len(results.errors) + len(results.failures) + + # Return the number of failures as the process exit code for automating success/failure reporting. + exit(numFailures) |