From 17337aceb0f1e989d965d1012e665dab33c44fea Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Fri, 20 Sep 2024 18:44:42 -0700 Subject: [PATCH] test_runner: Fail if child was terminated by signal --- misc/spoofed_criterion/test_runner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/spoofed_criterion/test_runner.c b/misc/spoofed_criterion/test_runner.c index fcad7c365..879abbdf1 100644 --- a/misc/spoofed_criterion/test_runner.c +++ b/misc/spoofed_criterion/test_runner.c @@ -29,6 +29,10 @@ int main() { perror("waitpid"); return 2; } + if WIFSIGNALED(stat) { + fprintf(stderr, "forked test child was terminated by signal %d\n", WTERMSIG(stat)); + return 1; + } int exit_status = WEXITSTATUS(stat); if (exit_status != test_info->exit_code) { fprintf(stderr, "forked test child exited with status %d, but %d was expected\n", exit_status, test_info->exit_code);