aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index a91e307a..706d13fb 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7455,6 +7455,37 @@ f.close()
self.assertContained('result: 12346.', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ def test_dup_o_in_a(self):
+ open('common.c', 'w').write(r'''
+ #include <stdio.h>
+ void a(void) {
+ printf("a\n");
+ }
+ ''')
+ Popen(['python', EMCC, 'common.c', '-c', '-o', 'common.o']).communicate()
+ Popen(['python', EMAR, 'rc', 'liba.a', 'common.o']).communicate()
+
+ open('common.c', 'w').write(r'''
+ #include <stdio.h>
+ void b(void) {
+ printf("b\n");
+ }
+ ''')
+ Popen(['python', EMCC, 'common.c', '-c', '-o', 'common.o']).communicate()
+ Popen(['python', EMAR, 'rc', 'libb.a', 'common.o']).communicate()
+
+ open('main.c', 'w').write(r'''
+ void a(void);
+ void b(void);
+ int main() {
+ a();
+ b();
+ }
+ ''')
+ Popen(['python', EMCC, 'main.c', '-L.', '-la', '-lb']).communicate()
+
+ self.assertContained('a\nb\n', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+
def test_embed_file(self):
open(os.path.join(self.get_dir(), 'somefile.txt'), 'w').write('''hello from a file with lots of data and stuff in it thank you very much''')
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r'''
@@ -7749,10 +7780,11 @@ f.close()
assert 'If you see this - the world is all right!' in output
def test_embind(self):
- # TODO: test -O1 and -O2
for args, fail in [
([], True), # without --bind, we fail
- (['--bind'], False)
+ (['--bind'], False),
+ (['--bind', '-O1'], False)
+ # XXX TODO (['--bind', '-O2'], False)
]:
print args, fail
try_delete(self.in_dir('a.out.js'))