diff options
author | Aleksander Guryanov <caiiiycuk@gmail.com> | 2013-01-12 13:29:12 +0700 |
---|---|---|
committer | Aleksander Guryanov <caiiiycuk@gmail.com> | 2013-01-17 21:16:26 +0700 |
commit | 4899a836579f064a0aa0df3b56fa15b3d4e04012 (patch) | |
tree | 0bc6283d2a5da4bdf7deb9ef75c55f4b7a0f5762 /tests/runner.py | |
parent | b6db6d7698dcfcf7878891027c0e4b3ac31e5bda (diff) |
Implement exceptions in whitelist
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index b8c7369e..a3904bb6 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -2372,6 +2372,38 @@ Exception execution path of first function! 1 Settings.DISABLE_EXCEPTION_CATCHING = 0 self.do_run(src, 'Throw...Construct...Catched...Destruct...Throw...Construct...Copy...Catched...Destruct...Destruct...') + def test_white_list_exception(self): + Settings.DISABLE_EXCEPTION_CATCHING = 2 + Settings.EXCEPTION_CATCHING_WHITELIST = ["__Z12somefunctionv"] + + src = ''' + #include <stdio.h> + + void thrower() { + printf("infunc..."); + throw(99); + printf("FAIL"); + } + + void somefunction() { + try { + thrower(); + } catch(...) { + printf("done!*\\n"); + } + } + + int main() { + somefunction(); + return 0; + } + ''' + self.do_run(src, 'infunc...done!*') + + Settings.DISABLE_EXCEPTION_CATCHING = 0 + Settings.EXCEPTION_CATCHING_WHITELIST = [] + + def test_uncaught_exception(self): if self.emcc_args is None: return self.skip('no libcxx inclusion without emcc') if '-O2' in self.emcc_args: |