diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-21 15:47:38 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-21 15:47:38 -0800 |
commit | eccb671c198a274e4e247afd2e962433e73967b8 (patch) | |
tree | 3dcf84f38314390a1b84d7e898780d753e8007f9 /tests | |
parent | 70eca301dc1f0b4f7cb9bab4b6beaf54c1487e05 (diff) |
add internal option to let emcc not compile inputs to bc. fixes test_cases
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/tests/runner.py b/tests/runner.py index d375cc69..2f52d6a3 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -4001,31 +4001,37 @@ def process(filename): # They are only valid enough for us to read for test purposes, not for llvm-as # to process. def test_cases(self): - self.banned_js_engines = [NODE_JS] # node issue 1669, exception causes stdout not to be flushed + try: + self.banned_js_engines = [NODE_JS] # node issue 1669, exception causes stdout not to be flushed - Settings.CHECK_OVERFLOWS = 0 - if Building.LLVM_OPTS: return self.skip("Our code is not exactly 'normal' llvm assembly") + os.environ['EMCC_LEAVE_INPUTS_RAW'] = '1' + + Settings.CHECK_OVERFLOWS = 0 + if Building.LLVM_OPTS: return self.skip("Our code is not exactly 'normal' llvm assembly") + + for name in glob.glob(path_from_root('tests', 'cases', '*.ll')): + shortname = name.replace('.ll', '') + if '' not in shortname: continue + print "Testing case '%s'..." % shortname + output_file = path_from_root('tests', 'cases', shortname + '.txt') + if Settings.QUANTUM_SIZE == 1: + q1_output_file = path_from_root('tests', 'cases', shortname + '_q1.txt') + if os.path.exists(q1_output_file): + output_file = q1_output_file + if os.path.exists(output_file): + output = open(output_file, 'r').read() + else: + output = 'hello, world!' + if output.rstrip() != 'skip': + self.do_ll_run(path_from_root('tests', 'cases', name), output) + # Optional source checking, a python script that gets a global generated with the source + src_checker = path_from_root('tests', 'cases', shortname + '.py') + if os.path.exists(src_checker): + generated = open('src.cpp.o.js').read() + exec(open(src_checker).read()) - for name in glob.glob(path_from_root('tests', 'cases', '*.ll')): - shortname = name.replace('.ll', '') - if '' not in shortname: continue - print "Testing case '%s'..." % shortname - output_file = path_from_root('tests', 'cases', shortname + '.txt') - if Settings.QUANTUM_SIZE == 1: - q1_output_file = path_from_root('tests', 'cases', shortname + '_q1.txt') - if os.path.exists(q1_output_file): - output_file = q1_output_file - if os.path.exists(output_file): - output = open(output_file, 'r').read() - else: - output = 'hello, world!' - if output.rstrip() != 'skip': - self.do_ll_run(path_from_root('tests', 'cases', name), output) - # Optional source checking, a python script that gets a global generated with the source - src_checker = path_from_root('tests', 'cases', shortname + '.py') - if os.path.exists(src_checker): - generated = open('src.cpp.o.js').read() - exec(open(src_checker).read()) + finally: + del os.environ['EMCC_LEAVE_INPUTS_RAW'] # Autodebug the code def do_autodebug(self, filename): |