aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-02-18 17:43:33 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-02-18 17:43:33 -0800
commit2e5522205545f910bcdf2e12c7cd7c7eca9a06bf (patch)
treebe2f4c7033b6da3f08d8d84f17e0854c7606ab58
parent175a660ad28a3c6180a5c9843f53c3536ee53992 (diff)
add test for atexit's still being called when exit is called
-rwxr-xr-xtests/runner.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 44fba344..f55975ca 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -5559,16 +5559,21 @@ def process(filename):
def test_exit_status(self):
Settings.CATCH_EXIT_CODE = 1
- src = '''
+ src = r'''
#include <stdio.h>
#include <stdlib.h>
+ static void cleanup() {
+ printf("cleanup\n");
+ }
+
int main()
{
- printf("hello, world!\\n");
+ atexit(cleanup); // this atexit should still be called
+ printf("hello, world!\n");
exit(118); // Unusual exit status to make sure it's working!
}
'''
- self.do_run(src, 'hello, world!\nExit Status: 118')
+ self.do_run(src, 'hello, world!\ncleanup\nExit Status: 118')
# Generate tests for everything