diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-14 12:39:24 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-14 12:39:24 -0700 |
commit | 860cf619431ace201478625c1af8d411824caa6b (patch) | |
tree | 754943e632bb6b3474eedd7ca958cade7964ed70 /tests/runner.py | |
parent | 86c90950a8ea0b942acb8fd17798b30c00fd72fa (diff) |
handle .a with identically named .o ; fixes #637
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 451ecdaf..7a6cbc26 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7402,6 +7402,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''' |