aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_glut.js4
-rwxr-xr-xtests/runner.py8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/library_glut.js b/src/library_glut.js
index e9329d02..0736d5ae 100644
--- a/src/library_glut.js
+++ b/src/library_glut.js
@@ -293,14 +293,14 @@ var LibraryGLUT = {
}
},
- glutMainLoop__deps: ['$GLUT', 'exit', 'glutPostRedisplay'],
+ glutMainLoop__deps: ['$GLUT', 'glutPostRedisplay'],
glutMainLoop: function() {
if (GLUT.reshapeFunc) {
FUNCTION_TABLE[GLUT.reshapeFunc](Module['canvas'].width,
Module['canvas'].height);
}
_glutPostRedisplay();
- _exit(0); // GLUT mainloop should never return
+ throw 'GLUT mainloop should never return';
},
};
diff --git a/tests/runner.py b/tests/runner.py
index b6673109..15f449c6 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6567,7 +6567,9 @@ elif 'browser' in str(sys.argv):
basename = os.path.basename(expected)
shutil.copyfile(expected, os.path.join(self.get_dir(), basename))
open(os.path.join(self.get_dir(), 'reftest.js'), 'w').write('''
- Module.postRun = function() {
+ function doReftest() {
+ if (doReftest.done) return;
+ doReftest.done = true;
var img = new Image();
img.onload = function() {
assert(img.width == Module.canvas.width);
@@ -6608,6 +6610,8 @@ elif 'browser' in str(sys.argv):
}
img.src = '%s';
};
+ Module.postRun = doReftest();
+ setTimeout(doReftest, 0); // if run() throws an exception, this will kick in
''' % basename)
def test_compression(self):
@@ -6859,7 +6863,7 @@ elif 'browser' in str(sys.argv):
def test_glgears(self):
self.reftest(path_from_root('tests', 'gears.png'))
output = Popen(['python', EMCC, path_from_root('tests', 'hello_world_gles.c'), '-o', 'something.html',
- '-DHAVE_BUILTIN_SINCOS', '--pre-js', 'reftest.js', '-s', 'CATCH_EXIT_CODE=1'],
+ '-DHAVE_BUILTIN_SINCOS', '--pre-js', 'reftest.js'],
stdout=PIPE, stderr=PIPE).communicate()
assert len(output[0]) == 0, output[0]
assert os.path.exists('something.html'), output