From 8884269037e36561f4ae19b873a7a8b5ccaf32f1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 16 Jul 2015 10:01:25 -0700 Subject: [PATCH] add test for static syscalls, checking that only the ones we need are pulled in --- tests/test_other.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_other.py b/tests/test_other.py index b9a5e969f..b1ec68e08 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -4929,3 +4929,10 @@ int main() { printf("Mary had a little lamb.\n"); } out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-s', 'DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=["alGetError"]', '-s', 'EXPORTED_FUNCTIONS=["_main", "_alGetError"]'], stdout=PIPE, stderr=PIPE).communicate() self.assertNotContained('''function requested to be exported, but not implemented: "_alGetError"''', err) + def test_static_syscalls(self): + Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c')]).communicate() + src = open('a.out.js').read() + matches = re.findall('''function ___syscall(\d+)\(''', src) + print 'seen syscalls:', matches + assert set(matches) == set(['6', '54', '140', '146']) # close, ioctl, llseek, writev +