diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-11-20 18:41:49 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-11-20 19:03:01 -0700 |
commit | fd763486d875968941c77386e23936e817856c8e (patch) | |
tree | ed85ffe2d6c27b502d06aefa5e63244450bb7028 /02-usart/test_harness/test_harness.c | |
parent | 3b6018348d51c77f53adca90e498d7bf268c91c9 (diff) | |
download | stm32l4-fd763486d875968941c77386e23936e817856c8e.tar.gz stm32l4-fd763486d875968941c77386e23936e817856c8e.tar.bz2 stm32l4-fd763486d875968941c77386e23936e817856c8e.zip |
Finally got a peripheral interrupt!
Diffstat (limited to '02-usart/test_harness/test_harness.c')
-rw-r--r-- | 02-usart/test_harness/test_harness.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/02-usart/test_harness/test_harness.c b/02-usart/test_harness/test_harness.c index 9f7dd79..3a6d10a 100644 --- a/02-usart/test_harness/test_harness.c +++ b/02-usart/test_harness/test_harness.c @@ -46,7 +46,6 @@ static int execute_test(test_t* test) int status; int ec; pid_t pid; - const char* note = ""; snprintf( fullname, sizeof(fullname), "%s::%s", iter->test_suite, iter->test_name); @@ -66,17 +65,21 @@ static int execute_test(test_t* test) return 1; } - ec = WEXITSTATUS(status); - switch (ec) { - case 0: - printf("%s " GREEN "[PASS]" RESET "\n", fullname); - return 0; - case 11: - note = " (SIGSEGV)"; - break; + if (WIFEXITED(status)) { + switch ((ec = WEXITSTATUS(status))) { + case 0: + printf("%s " GREEN "[PASS]" RESET "\n", fullname); + return 0; + default: + printf("%s " RED "[FAIL] %d" RESET "\n", fullname, ec); + return ec; + } + } else if (WIFSIGNALED(status)) { + int ec = WTERMSIG(status); + printf("%s " RED "[FAIL] signaled %d" RESET "\n", fullname, ec); + return ec; } - printf("%s " RED "[FAIL] %d%s" RESET "\n", fullname, ec, note); return ec; } } |