diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-20 18:36:30 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-20 18:36:30 -0700 |
commit | 25c6032a589f751573d0623645163fcd03192fc2 (patch) | |
tree | ee7c3351e59fa4a0b5935ce07105da26f83d2710 /tests/runner.py | |
parent | 2781c7dca6685dbb4519f1bf77c3d3f4611b0f90 (diff) |
check node version is at least 0.6.8, which is the first to not have v8 bug 1895; enable crankshaft in js optimizer for additional speed
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index a419ff0d..41b9ee19 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -9725,6 +9725,50 @@ elif 'sanity' in str(sys.argv): finally: del os.environ['EM_IGNORE_SANITY'] + def test_node(self): + NODE_WARNING = 'warning: node version appears too old' + NODE_WARNING_2 = 'warning: cannot check node version' + + restore() + + # Clang should report the version number we expect, and emcc should not warn + assert check_node_version() + output = self.check_working(EMCC) + assert NODE_WARNING not in output, output + + # Fake a different node version + restore() + f = open(CONFIG_FILE, 'a') + f.write('NODE_JS = "' + path_from_root('tests', 'fake', 'nodejs') + '"') + f.close() + + if not os.path.exists(path_from_root('tests', 'fake')): + os.makedirs(path_from_root('tests', 'fake')) + + try: + os.environ['EM_IGNORE_SANITY'] = '1' + for version, succeed in [(('v0.6.6'), False), (('v0.6.7'), False), (('v0.6.8'), True), (('v0.6.9'), True), (('v0.7.1'), True), (('v0.7.9'), True), (('v0.8.7'), True), (('v0.8.9'), True), ('cheez', False)]: + f = open(path_from_root('tests', 'fake', 'nodejs'), 'w') + f.write('#!/bin/sh\n') + f.write('''if [ $1 = "--version" ]; then + echo "%s" +else + %s $@ +fi +''' % (version, NODE_JS)) + f.close() + os.chmod(path_from_root('tests', 'fake', 'nodejs'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) + if not succeed: + if version[0] == 'v': + self.check_working(EMCC, NODE_WARNING) + else: + self.check_working(EMCC, NODE_WARNING_2) + else: + output = self.check_working(EMCC) + assert NODE_WARNING not in output, output + finally: + del os.environ['EM_IGNORE_SANITY'] + def test_emcc(self): SANITY_MESSAGE = 'Emscripten: Running sanity checks' SANITY_FAIL_MESSAGE = 'sanity check failed to run' |