Skip to content

Commit

Permalink
make other.test_emterpretify more tolerant of native optimizer variab…
Browse files Browse the repository at this point in the history
…ility
  • Loading branch information
kripken committed Dec 17, 2014
1 parent d5ed105 commit 6df1475
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -4391,10 +4391,19 @@ def do_log_test(source, expected, func):
assert func in pre, pre
post = post.split('\n')[0]
seen = int(post)
assert expected == seen, ['expect', expected, 'but see', seen]
assert expected == seen or seen in expected, ['expect', expected, 'but see', seen]

do_log_test(path_from_root('tests', 'primes.cpp'), 86, 'main')
do_log_test(path_from_root('tests', 'fannkuch.cpp'), 234, 'fannkuch_worker')
do_log_test(path_from_root('tests', 'fannkuch.cpp'), range(234, 239), 'fannkuch_worker')

# test non-native as well, registerizeHarder can be a little more efficient here
old_native = os.environ.get('EMCC_NATIVE_OPTIMIZER')
try:
os.environ['EMCC_NATIVE_OPTIMIZER'] = '0'
do_log_test(path_from_root('tests', 'fannkuch.cpp'), 234, 'fannkuch_worker')
finally:
if old_native: os.environ['EMCC_NATIVE_OPTIMIZER'] = old_native
else: del os.environ['EMCC_NATIVE_OPTIMIZER']

def test_emterpreter_swap_orig(self):
Popen([PYTHON, EMCC, path_from_root('tests', 'fasta.cpp'), '-s', 'EMTERPRETIFY=1', '-s', 'SWAPPABLE_ASM_MODULE=1', '-O2']).communicate()
Expand Down

0 comments on commit 6df1475

Please sign in to comment.