diff options
Diffstat (limited to 'tests/test_other.py')
-rw-r--r-- | tests/test_other.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index 137a83b1..4a6296e0 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -2291,15 +2291,17 @@ mergeInto(LibraryManager.library, { self.clear() os.mkdir(outdir) - process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir]) - process.communicate() - assert(os.path.isfile(outdir + 'hello_world.o')) + process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir], stderr=PIPE) + out, err = process.communicate() + assert not err, err + assert os.path.isfile(outdir + 'hello_world.o') self.clear() os.mkdir(outdir) - process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj']) - process.communicate() - assert(os.path.isfile(outdir + 'hello_world.obj')) + process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj'], stderr=PIPE) + out, err = process.communicate() + assert not err, err + assert os.path.isfile(outdir + 'hello_world.obj') def test_doublestart_bug(self): open('code.cpp', 'w').write(r''' @@ -2789,3 +2791,14 @@ int main(int argc, char **argv) { assert sizes[0] == 7 # no aliasing, all unique, fat tables assert sizes[1] == 3 # aliased once more + def test_bad_export(self): + for m in ['', ' ']: + self.clear() + cmd = [PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-s', 'EXPORTED_FUNCTIONS=["' + m + '_main"]'] + print cmd + stdout, stderr = Popen(cmd, stderr=PIPE).communicate() + if m: + assert 'function requested to be exported, but not implemented: " _main"' in stderr, stderr + else: + self.assertContained('hello, world!', run_js('a.out.js')) + |