aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-25 15:44:54 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-25 15:44:54 -0700
commit46630aa446c6e984c5e3c745bf36cb7fa555c309 (patch)
tree21ef348989507b3e641666c00750bf50972f4d28 /tests
parentca2633c8217e77a20ab96f301cec008d46923968 (diff)
informative error on bad function pointer call with ASSERTIONS=1
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 860fe8ae..8168f332 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -9619,13 +9619,16 @@ f.close()
def test(args, expected, err_expected=None):
out, err = Popen([PYTHON, EMCC, 'src.c'] + args, stderr=PIPE).communicate()
if err_expected: self.assertContained(err_expected, err)
- self.assertContained(expected, run_js(self.in_dir('a.out.js'), stderr=PIPE))
+ self.assertContained(expected, run_js(self.in_dir('a.out.js'), stderr=PIPE, full_output=True))
return open(self.in_dir('a.out.js')).read()
test([], 'my func') # no asm, so casting func works
test(['-O2'], 'abort', ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func',
'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure
- #test(['-O2', '-g'], 'abort') # asm -g gives better message, so failure
+ test(['-O2', '-s', 'ASSERTIONS=1'],
+ 'Invalid function pointer called. Perhaps a miscast function pointer (check compilation warnings) or bad vtable lookup (maybe due to derefing a bad pointer, like NULL)?',
+ ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func',
+ 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure
def test_l_link(self):
# Linking with -lLIBNAME and -L/DIRNAME should work