aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-28 11:37:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:03 -0700
commitb231d9fa1bb543f51257a545ccef84bc8b701843 (patch)
treede03b0332c1befaf8dc2a42e8f4627d8973225ce
parent0561274642ce8febd8b877927b8750573771ee3b (diff)
add optional header to test_static_link
-rwxr-xr-xtests/runner.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 97605011..8944f621 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10612,9 +10612,10 @@ f.close()
def test_static_link(self):
print
- def test(name, main, side, expected, first=True):
+ def test(name, header, main, side, expected, first=True):
print name
#t = main ; main = side ; side = t
+ if header: open(os.path.join(self.get_dir(), 'header.h'), 'w').write(header)
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(main)
open(os.path.join(self.get_dir(), 'side.cpp'), 'w').write(side)
Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'side.cpp'), '-o', 'side.js', '-s', 'SIDE_MODULE=1', '-O2']).communicate()
@@ -10625,10 +10626,10 @@ f.close()
out = run_js('together.js', engine=SPIDERMONKEY_ENGINE, stderr=PIPE, full_output=True)
self.assertContained(expected, out)
self.validate_asmjs(out)
- if first: test(name + ' (reverse)', side, main, expected, False) # test reverse order
+ if first: test(name + ' (reverse)', header, side, main, expected, False) # test reverse order
# test a simple call from one module to another. only one has a string (and constant memory initialization for it)
- test('basics', '''
+ test('basics', '', '''
#include <stdio.h>
extern int sidey();
int main() {
@@ -10640,7 +10641,7 @@ f.close()
''', 'other says 11.')
# memory initialization in both
- test('multiple memory inits', r'''
+ test('multiple memory inits', '', r'''
#include <stdio.h>
extern void sidey();
int main() {