Skip to content

Commit

Permalink
Merge branch 'premain-noexitruntime' of https://github.com/NWilson/em…
Browse files Browse the repository at this point in the history
…scripten into incoming
  • Loading branch information
kripken committed May 22, 2015
2 parents 4306204 + 5e63380 commit 615a04e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7041,6 +7041,26 @@ def test_exit_status(self):
self.emcc_args += ['-s', 'INVOKE_RUN=0', '--post-js', 'post.js']
self.do_run(src, 'hello, world!\ncleanup\nI see exit status: 118')

def test_noexitruntime(self):
src = r'''
#include <emscripten.h>
#include <stdio.h>
static int testPre = TEST_PRE;
struct Global {
Global() {
printf("in Global()\n");
if (testPre) { EM_ASM(Module['noExitRuntime'] = true;); }
}
~Global() { printf("ERROR: in ~Global()\n"); }
} global;
int main() {
if (!testPre) { EM_ASM(Module['noExitRuntime'] = true;); }
printf("in main()\n");
}
'''
self.do_run(src.replace('TEST_PRE', '0'), 'in Global()\nin main()')
self.do_run(src.replace('TEST_PRE', '1'), 'in Global()\nin main()')

def test_minmax(self):
self.do_run(open(path_from_root('tests', 'test_minmax.c')).read(), 'NAN != NAN\nSuccess!')

Expand Down

0 comments on commit 615a04e

Please sign in to comment.