diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-24 17:36:40 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-24 17:36:40 +0100 |
commit | a27c01ed25bcba9abda5f06d79ab166ea5e9d608 (patch) | |
tree | f7db9c5eafe82c47359a42c7ecaccf547132551f /tests | |
parent | 915d48e596c36117b58c8d530f72abac8ea28e8e (diff) |
allow limited the amount of named globals
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py index deeb5689..1d85b3df 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1645,7 +1645,15 @@ c5,de,15,8a return 0; } ''' - self.do_run(src, '4:10,177,543,def\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another\ntest\n', ['wowie', 'too', '74']) + for named, expected in [(-1, 0), (0, 100), (1, 98), (5, 88), (1000, 0)]: + print named + Settings.NUM_NAMED_GLOBALS = named + self.do_run(src, '4:10,177,543,def\n4\nwowie\ntoo\n76\n5\n(null)\n/* a comment */\n// another\ntest\n', ['wowie', 'too', '74']) + if self.emcc_args == []: + gen = open(self.in_dir('src.cpp.o.js')).read() + count = gen.count('GLOBAL_BASE') + assert count == expected + print ' counted' def test_strcmp_uni(self): src = ''' |