diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-17 18:38:25 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-17 18:38:25 -0800 |
commit | 2913e6efd9acd4180847ed1f3ed84d450e8719de (patch) | |
tree | 9cbd74e4331eb5ca1c7787ecd31da247219ecdbb /tests/runner.py | |
parent | 33b7ca2795983813467d796edb8dd9d380a288bd (diff) | |
parent | 4899a836579f064a0aa0df3b56fa15b3d4e04012 (diff) |
Merge pull request #778 from caiiiycuk/exception_catching_in_scope
Implement exceptions in scopes
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: |