aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py78
1 files changed, 45 insertions, 33 deletions
diff --git a/tests/runner.py b/tests/runner.py
index b94affb2..a92f4bc4 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3376,17 +3376,41 @@ Exiting setjmp function, level: 0, prev_jmp: -1
if self.emcc_args is None: return self.skip('need c99')
self.emcc_args += ['-std=c99']
src = open(path_from_root('tests', 'life.c'), 'r').read()
- self.do_run(src, '''--------
- [][][]
-[][]
- []
- []
-[][]
-
-
-
---------
-''', ['8', '8', '25000'], force_c=True)
+ self.do_run(src, '''--------------------------------
+[] [] [][][]
+ [] [] [] [][] [] [] []
+[] [][] [][] [][][] []
+ [] [] [] [] [][] [] []
+ [] [][] [] [] [] [] [][][][]
+ [][] [][] [] [][][] [] []
+ [] [][] [][] [][] [][][]
+ [][] [][][] [] []
+ [][] [][] []
+ [][][]
+ []
+
+
+
+
+ [][][]
+ [] [][] [][]
+ [][] [] [][] [][]
+ [][] [][]
+ []
+ [][]
+ [][] []
+[] [][] []
+ [][][] []
+ [] [][]
+[] [] []
+ []
+[] [] []
+ [][][]
+
+ []
+ [][][] []
+--------------------------------
+''', ['0'], force_c=True)
def test_array2(self):
src = '''
@@ -9404,7 +9428,7 @@ Options that are modified or new in %s include:
output = Popen([PYTHON, compiler, 'twopart_main.o'] + args, stdout=PIPE, stderr=PIPE).communicate()
assert os.path.exists(target), '\n'.join(output)
#print '\n'.join(output)
- self.assertContained('is not a function', run_js(target, stderr=STDOUT))
+ self.assertContained('missing function', run_js(target, stderr=STDOUT))
try_delete(target)
# Combining those bc files into js should work
@@ -9722,21 +9746,6 @@ f.close()
self.assertContained('result: 62', run_js(os.path.join(self.get_dir(), 'a.out.js')))
- def test_asm_undefined(self):
- src = r'''
- #include <stdio.h>
- extern void doit();
- int main(int argc, char **argv) {
- if (argc == 121) doit();
- printf("done\n");
- return 1;
- }
- '''
- filename = self.in_dir('src.cpp')
- open(filename, 'w').write(src)
- out, err = Popen([PYTHON, EMCC, filename, '-s', 'ASM_JS=1', '-O2'], stderr=PIPE).communicate()
- assert 'Unresolved symbol' in err, 'always warn on undefs in asm, since it breaks validation: ' + err
-
def test_redundant_link(self):
lib = "int mult() { return 1; }"
lib_name = os.path.join(self.get_dir(), 'libA.c')
@@ -9862,7 +9871,7 @@ f.close()
Popen([PYTHON, EMCC, 'testa.cpp', '-o', 'liba.js', '-s', 'BUILD_AS_SHARED_LIB=2', '-s', 'LINKABLE=1', '-s', 'NAMED_GLOBALS=1', '-I.']).communicate()
Popen([PYTHON, EMCC, 'testb.cpp', '-o', 'libb.js', '-s', 'BUILD_AS_SHARED_LIB=2', '-s', 'LINKABLE=1', '-s', 'NAMED_GLOBALS=1', '-I.']).communicate()
- Popen([PYTHON, EMCC, 'main.cpp', '-o', 'main.js', '-s', 'RUNTIME_LINKED_LIBS=["liba.js", "libb.js"]', '-s', 'NAMED_GLOBALS=1', '-I.']).communicate()
+ Popen([PYTHON, EMCC, 'main.cpp', '-o', 'main.js', '-s', 'RUNTIME_LINKED_LIBS=["liba.js", "libb.js"]', '-s', 'NAMED_GLOBALS=1', '-I.', '-s', 'LINKABLE=1']).communicate()
Popen([PYTHON, EMCC, 'main.cpp', 'testa.cpp', 'testb.cpp', '-o', 'full.js', '-I.']).communicate()
@@ -10189,11 +10198,14 @@ f.close()
return 0;
}
''')
- output = Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '-s', 'WARN_ON_UNDEFINED_SYMBOLS=1'], stderr=PIPE).communicate()
- self.assertContained('Unresolved symbol: _something', output[1])
- output = Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp')], stderr=PIPE).communicate()
- self.assertNotContained('Unresolved symbol: _something\n', output[1])
+ for args in [[], ['-O2']]:
+ print args
+ output = Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '-s', 'WARN_ON_UNDEFINED_SYMBOLS=1'] + args, stderr=PIPE).communicate()
+ self.assertContained('unresolved symbol: something', output[1])
+
+ output = Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp')] + args, stderr=PIPE).communicate()
+ self.assertNotContained('unresolved symbol: something\n', output[1])
def test_toobig(self):
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r'''
@@ -10462,7 +10474,7 @@ f.close()
output = Popen([os.path.join(self.get_dir(), 'files.o.run')], stdin=open(os.path.join(self.get_dir(), 'stdin')), stdout=PIPE, stderr=PIPE).communicate()
self.assertContained('''size: 37
data: 119,97,107,97,32,119,97,107,97,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35
-loop: 119 97 107 97 32 119 97 107 97 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
+loop: 119 97 107 97 32 119 97 107 97 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
input:inter-active
texto
$