aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 7ae2dc41..5602fd94 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2310,6 +2310,7 @@ cat |umber one top notchfi FI FO FUM WHEN WHERE WHY HOW WHO|''', ['wowie', 'too'
self.do_run(src, 'Assertion failed: 1 == false')
def test_libcextra(self):
+ if self.emcc_args is None: return self.skip('needs emcc for libcextra')
src = r'''
#include <stdio.h>
#include <wchar.h>
@@ -8170,11 +8171,12 @@ def process(filename):
# Kill off the dead function, still works and it is not emitted
Settings.DEAD_FUNCTIONS = ['_unused']
js = test('*9*')
- assert 'function _unused(' not in js
+ assert 'function _unused($' not in js # no compiled code
+ assert 'function _unused(' in js # lib-generated stub
Settings.DEAD_FUNCTIONS = []
# Run the same code with argc that uses the dead function, see abort
- test(('dead:_unused' if Settings.ASSERTIONS else 'abort', 'is not a function'), args=['a', 'b'], no_build=True)
+ test(('missing function: unused'), args=['a', 'b'], no_build=True)
# Normal stuff
run_all('normal', r'''
@@ -8249,7 +8251,7 @@ def process(filename):
before = len(open('normal.js').read())
after = len(open('pgoed.js').read())
- assert after < 0.66 * before, [before, after] # expect a big size reduction
+ assert after < 0.90 * before, [before, after] # expect a size reduction
# with response in settings element itself
@@ -10356,7 +10358,7 @@ f.close()
(1, 0, 3, 2), (1, 1, 3, 4)
]:
print asm, linkable, chunks, js_chunks
- output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm, '-s', 'UNRESOLVED_AS_DEAD=1'] + (['-O2'] if asm else []), stdout=PIPE, stderr=PIPE).communicate()
+ output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm] + (['-O2'] if asm else []), stdout=PIPE, stderr=PIPE).communicate()
ok = False
for c in range(chunks, chunks+2):
ok = ok or ('phase 2 working on %d chunks' % c in err)