aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-26 18:41:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-26 18:41:50 -0700
commita58b8512cf1e067ca1c63599d6b22de4471232db (patch)
tree8e03fbd761e4ca0b9f58fc743116995410844599 /tests
parentc99f5607a3e3b7d473c5ecac958ffb86e15cafdc (diff)
test for EMCC_DEBUG mode not generating different code
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/tests/runner.py b/tests/runner.py
index ac3141a7..ce848b08 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -5870,13 +5870,7 @@ def process(filename):
return output
- try:
- # some test coverage for EMCC_DEBUG
- adding_debug = self.emcc_args and '-O2' in self.emcc_args and 'EMCC_DEBUG' not in os.environ
- if adding_debug:
- print >> sys.stderr, 'running in EMCC_DEBUG mode for test coverage'
- os.environ['EMCC_DEBUG'] = '1'
-
+ def do_test():
self.do_run(open(path_from_root('tests', 'openjpeg', 'codec', 'j2k_to_image.c'), 'r').read(),
'Successfully generated', # The real test for valid output is in image_compare
'-i image.j2k -o image.raw'.split(' '),
@@ -5888,8 +5882,19 @@ def process(filename):
force_c=True,
post_build=post,
output_nicerizer=image_compare)#, build_ll_hook=self.do_autodebug)
- finally:
- if adding_debug: del os.environ['EMCC_DEBUG']
+
+ do_test()
+
+ # some test coverage for EMCC_DEBUG
+ if self.emcc_args and '-O2' in self.emcc_args and 'EMCC_DEBUG' not in os.environ:
+ shutil.copyfile('src.c.o.js', 'release.js')
+ try:
+ os.environ['EMCC_DEBUG'] = '1'
+ do_test()
+ finally:
+ del os.environ['EMCC_DEBUG']
+ shutil.copyfile('src.c.o.js', 'debug.js')
+ self.assertIdentical(open('release.js').read().replace('\n\n', '\n').replace('\n\n', '\n'), open('debug.js').read().replace('\n\n', '\n').replace('\n\n', '\n')) # EMCC_DEBUG=1 mode must not generate different code!
def test_python(self):
if Settings.QUANTUM_SIZE == 1: return self.skip('TODO: make this work')