aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-30 14:21:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-30 14:21:15 -0700
commite6820abcba785a2b54240920c7c9bf649eb5270c (patch)
treec0dbeae471e738e7c67a6215868b7153bf3f7186 /tests/runner.py
parent49f6c7e7c295c0ec0bbd99683de7330f1cffd8dd (diff)
fix and test for multiple static linking
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index c813a921..a4b396f2 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -11034,6 +11034,23 @@ f.close()
std::string side() { return "and hello from side"; }
''', ['hello from main and hello from side\n'])
+ # followup to iostream test: a second linking
+ print 'second linking of a linking output'
+ open('moar.cpp', 'w').write(r'''
+ #include <iostream>
+ struct Moar {
+ Moar() { std::cout << "moar!" << std::endl; }
+ };
+ Moar m;
+ ''')
+ Popen([PYTHON, EMCC, 'moar.cpp', '-o', 'moar.js', '-s', 'SIDE_MODULE=1', '-O2']).communicate()
+ Popen([PYTHON, EMLINK, 'together.js', 'moar.js', 'triple.js'], stdout=PIPE).communicate()
+ assert os.path.exists('triple.js')
+ for engine in JS_ENGINES:
+ out = run_js('triple.js', engine=engine, stderr=PIPE, full_output=True)
+ self.assertContained('moar!\nhello from main and hello from side\n', out)
+ if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out)
+
# zlib compression library. tests function pointers in initializers and many other things
test('zlib', '', open(path_from_root('tests', 'zlib', 'example.c'), 'r').read(),
self.get_library('zlib', os.path.join('libz.a'), make_args=['libz.a']),