aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-25 21:26:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:03 -0700
commit0561274642ce8febd8b877927b8750573771ee3b (patch)
tree0726ca2a3a810d106d866b40bc0062037f0dd910 /tests/runner.py
parent5e01920010c51286010e0d59d5b7541aad0678e8 (diff)
fix memory initializer counting and add test for merging of two of them
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 f875ca3d..97605011 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10610,6 +10610,8 @@ f.close()
assert not os.path.exists('a.out') and not os.path.exists('a.exe'), 'Must not leave unneeded linker stubs'
def test_static_link(self):
+ print
+
def test(name, main, side, expected, first=True):
print name
#t = main ; main = side ; side = t
@@ -10625,6 +10627,7 @@ f.close()
self.validate_asmjs(out)
if first: test(name + ' (reverse)', 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', '''
#include <stdio.h>
extern int sidey();
@@ -10636,6 +10639,20 @@ f.close()
int sidey() { return 11; }
''', 'other says 11.')
+ # memory initialization in both
+ test('multiple memory inits', r'''
+ #include <stdio.h>
+ extern void sidey();
+ int main() {
+ printf("hello from main\n");
+ sidey();
+ return 0;
+ }
+ ''', r'''
+ #include <stdio.h>
+ void sidey() { printf("hello from side\n"); }
+ ''', 'hello from main\nhello from side\n')
+
def test_symlink(self):
if os.name == 'nt':
return self.skip('Windows FS does not need to be tested for symlinks support, since it does not have them.')