aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-31 10:45:17 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-31 10:45:17 -0800
commitc861de5c8f63280ff2826952f5e7ad03440011ac (patch)
tree6082ab1b4946e48299f2dbe44a86b10fba895ca7 /tests
parentd11d9ece64662cc540af0c5430fa6eea0cc8d01c (diff)
sanity check for js backend in fastcomp
Diffstat (limited to 'tests')
-rw-r--r--tests/test_sanity.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_sanity.py b/tests/test_sanity.py
index dc3d53db..e8b1f885 100644
--- a/tests/test_sanity.py
+++ b/tests/test_sanity.py
@@ -195,6 +195,34 @@ class sanity(RunnerCore):
finally:
del os.environ['EM_IGNORE_SANITY']
+ def test_llvm_fastcomp(self):
+ if os.environ.get('EMCC_FAST_COMPILER') != '1': return self.skip('not using fastcomp')
+
+ WARNING = 'fastcomp in use, but LLVM has not been built with the JavaScript backend as a target'
+
+ restore()
+
+ # Should see js backend during sanity check
+ assert check_fastcomp()
+ output = self.check_working(EMCC)
+ assert WARNING not in output, output
+
+ # Fake incorrect llc output, no mention of js backend
+ restore()
+ f = open(CONFIG_FILE, 'a')
+ f.write('LLVM_ROOT = "' + path_from_root('tests', 'fake') + '"')
+ f.close()
+
+ if not os.path.exists(path_from_root('tests', 'fake')):
+ os.makedirs(path_from_root('tests', 'fake'))
+
+ f = open(path_from_root('tests', 'fake', 'llc'), 'w')
+ f.write('#!/bin/sh\n')
+ f.write('echo "llc fake output\nRegistered Targets:\nno j-s backend for you!"')
+ f.close()
+ os.chmod(path_from_root('tests', 'fake', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
+ output = self.check_working(EMCC, WARNING)
+
def test_node(self):
NODE_WARNING = 'node version appears too old'
NODE_WARNING_2 = 'cannot check node version'