diff options
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/tests/runner.py b/tests/runner.py index 501299c7..87f8a036 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -27,6 +27,19 @@ sys.path += [path_from_root(''), path_from_root('third_party/websockify')] import tools.shared from tools.shared import * +# Utils + +def nonfastcomp(test): + try: + old_fastcomp = os.environ.get('EMCC_FAST_COMPILER') + os.environ['EMCC_FAST_COMPILER'] = '0' + test() + finally: + if old_fastcomp is None: + del os.environ['EMCC_FAST_COMPILER'] + else: + os.environ['EMCC_FAST_COMPILER'] = old_fastcomp + # Sanity check for config try: @@ -36,10 +49,7 @@ except: # Core test runner class, shared between normal tests and benchmarks checked_sanity = False -if os.environ.get('EMCC_FAST_COMPILER') == '1': - test_modes = ['default', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g'] -else: - test_modes = ['default', 'o1', 'o2', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g', 'asm2x86', 's_0_0', 's_0_1'] +test_modes = ['default', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g', 'slow2', 'slow2asm', 's_0_0', 's_0_1'] test_index = 0 class RunnerCore(unittest.TestCase): @@ -244,7 +254,7 @@ process(sys.argv[1]) if 'uccessfully compiled asm.js code' in err and 'asm.js link error' not in err: print >> sys.stderr, "[was asm.js'ified]" elif 'asm.js' in err: # if no asm.js error, then not an odin build - raise Exception("did NOT asm.js'ify") + raise Exception("did NOT asm.js'ify: " + err) err = '\n'.join(filter(lambda line: 'uccessfully compiled asm.js code' not in line, err.split('\n'))) return err @@ -342,7 +352,7 @@ process(sys.argv[1]) build_dir = self.get_build_dir() output_dir = self.get_dir() - cache_name = name + str(Building.COMPILER_TEST_OPTS) + cache_name_extra + (self.env.get('EMCC_LLVM_TARGET') or '') + cache_name = name + str(Building.COMPILER_TEST_OPTS) + cache_name_extra + (self.env.get('EMCC_LLVM_TARGET') or '_') + (self.env.get('EMCC_FAST_COMPILER') or '_') valid_chars = "_%s%s" % (string.ascii_letters, string.digits) cache_name = ''.join([(c if c in valid_chars else '_') for c in cache_name]) @@ -573,7 +583,7 @@ class BrowserCore(RunnerCore): def with_report_result(self, code): return r''' - #if EMSCRIPTEN + #ifdef __EMSCRIPTEN__ #include <emscripten.h> #define REPORT_RESULT_INTERNAL(sync) \ char output[1000]; \ @@ -769,23 +779,20 @@ A recommended order is: (the main test suite) other - tests separate from the main suite browser - runs pages in a web browser + interactive - runs interactive browser tests that need human verification, and could not be automated sockets - runs websocket networking tests benchmark - run before and after each set of changes before pushing to master, verify no regressions -There are also commands to run specific subsets of the test suite: - - browser.audio - runs audio tests in a web browser (requires human verification) - To run one of those parts, do something like python tests/runner.py sanity To run a specific set of tests, you can do things like - python tests/runner.py o1 + python tests/runner.py asm2 -(that runs the o1 (-O1) tests). You can run individual tests with +(that runs the asm2 (asm.js, -O2) tests). You can run individual tests with python tests/runner.py test_hello_world |