diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 13:56:44 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:57 +0200 |
commit | 49f31cb986114aff69e433ad0d7c515007a45ebc (patch) | |
tree | 0d5b641f10803bd5834a2b33260bc25467984cd1 | |
parent | 38ad629ca30add842a91de7e1346380741707fd2 (diff) |
Use do_run_from_file() for test_atexit
-rw-r--r-- | tests/core/test_atexit.in | 17 | ||||
-rw-r--r-- | tests/core/test_atexit.out | 1 | ||||
-rw-r--r-- | tests/test_core.py | 20 |
3 files changed, 21 insertions, 17 deletions
diff --git a/tests/core/test_atexit.in b/tests/core/test_atexit.in new file mode 100644 index 00000000..56489a6c --- /dev/null +++ b/tests/core/test_atexit.in @@ -0,0 +1,17 @@ + + #include <stdio.h> + #include <stdlib.h> + + static void cleanA() { + printf("A"); + } + static void cleanB() { + printf("B"); + } + + int main() { + atexit(cleanA); + atexit(cleanB); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_atexit.out b/tests/core/test_atexit.out new file mode 100644 index 00000000..c1c30196 --- /dev/null +++ b/tests/core/test_atexit.out @@ -0,0 +1 @@ +BA
\ No newline at end of file diff --git a/tests/test_core.py b/tests/test_core.py index 64a195e1..49a4d094 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -2418,24 +2418,10 @@ The current type of b is: 9 def test_atexit(self): # Confirms they are called in reverse order - src = r''' - #include <stdio.h> - #include <stdlib.h> - - static void cleanA() { - printf("A"); - } - static void cleanB() { - printf("B"); - } + test_path = path_from_root('tests', 'core', 'test_atexit') + src, output = (test_path + s for s in ('.in', '.out')) - int main() { - atexit(cleanA); - atexit(cleanB); - return 0; - } - ''' - self.do_run(src, 'BA') + self.do_run_from_file(src, output) def test_pthread_specific(self): if self.emcc_args is None: return self.skip('requires emcc') |