diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-19 13:54:43 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-19 13:54:43 -0800 |
commit | fca29f7958688e613801f4f13c784796f1270bad (patch) | |
tree | dcdc2461d3ec76ad5c74e0752896b1746b88ae0f /tests/runner.py | |
parent | 1327ff5cbb6f0c433b64f713dd95acb0f09a669f (diff) |
tolerate people issuing link commands with duplicates in them
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 775225c6..9982d0ef 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8139,6 +8139,27 @@ f.close() self.assertContained('result: 62', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + def test_redundant_link(self): + lib = "int mult() { return 1; }" + lib_name = os.path.join(self.get_dir(), 'libA.c') + open(lib_name, 'w').write(lib) + main = r''' + #include <stdio.h> + int mult(); + int main() { + printf("result: %d\n", mult()); + return 0; + } + ''' + main_name = os.path.join(self.get_dir(), 'main.c') + open(main_name, 'w').write(main) + + Building.emcc(lib_name, output_filename='libA.so') + + Building.emcc(main_name, ['libA.so']*2, output_filename='a.out.js') + + self.assertContained('result: 1', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + def test_abspaths(self): # Includes with absolute paths are generally dangerous, things like -I/usr/.. will get to system local headers, not our portable ones. |