diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 11:36:12 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:54 +0200 |
commit | 6fdd8f7222a1ba02ad63116e9a602ea69fac178e (patch) | |
tree | 6029fe5eef0ae388176be997a1ab46786b1e59e7 | |
parent | c287ef1ae8d4a5349ba677086702ae085dd4cfda (diff) |
Use do_run_from_file() for test_std_exception
-rw-r--r-- | tests/core/test_std_exception.in | 15 | ||||
-rw-r--r-- | tests/core/test_std_exception.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 18 |
3 files changed, 19 insertions, 15 deletions
diff --git a/tests/core/test_std_exception.in b/tests/core/test_std_exception.in new file mode 100644 index 00000000..280faed2 --- /dev/null +++ b/tests/core/test_std_exception.in @@ -0,0 +1,15 @@ + + #include <stdio.h> + #include <exception> + + int main() + { + std::exception e; + try { + throw e; + } catch(std::exception e) { + printf("caught std::exception\n"); + } + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_std_exception.out b/tests/core/test_std_exception.out new file mode 100644 index 00000000..c1660de4 --- /dev/null +++ b/tests/core/test_std_exception.out @@ -0,0 +1 @@ +caught std::exception
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index c33bef18..6e378785 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1322,22 +1322,10 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co Settings.DISABLE_EXCEPTION_CATCHING = 0 self.emcc_args += ['-s', 'SAFE_HEAP=0'] - src = r''' - #include <stdio.h> - #include <exception> + test_path = path_from_root('tests', 'core', 'test_std_exception') + src, output = (test_path + s for s in ('.in', '.out')) - int main() - { - std::exception e; - try { - throw e; - } catch(std::exception e) { - printf("caught std::exception\n"); - } - return 0; - } - ''' - self.do_run(src, 'caught std::exception') + self.do_run_from_file(src, output) def test_async_exit(self): open('main.c', 'w').write(r''' |