From: Michael Jeanson Date: Mon, 13 Jul 2020 19:22:35 +0000 (-0400) Subject: tests: return the proper TAP exit code X-Git-Tag: v2.11.3~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1e160d581926ab1a75b4f061d35672aad6c232c5;p=lttng-ust.git tests: return the proper TAP exit code The C TAP library provides the 'exit_status()' function that will return the proper exit code according to the number of tests that succeeded or failed. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I786527dfa9cfe2d1a7c8bc80086d54186f60b4d9 --- diff --git a/tests/gcc-weak-hidden/main.c b/tests/gcc-weak-hidden/main.c index 78199f5b..0a80c05b 100644 --- a/tests/gcc-weak-hidden/main.c +++ b/tests/gcc-weak-hidden/main.c @@ -82,5 +82,6 @@ int main() "Weak-hidden behavior is the same for 4 bytes integer and pointer objects within main program"); ok(match_matrix[MATCH_LIB_INT] == match_matrix[MATCH_LIB_PTR], "Weak-hidden behavior is the same for 4 bytes integer and pointer objects within shared library"); - return 0; + + return exit_status(); } diff --git a/tests/snprintf/prog.c b/tests/snprintf/prog.c index 8d3fd5c0..c1087402 100644 --- a/tests/snprintf/prog.c +++ b/tests/snprintf/prog.c @@ -38,5 +38,5 @@ int main() sprintf(test_desc, test_desc_fmt_str, escaped_test_fmt_str); ok(strcmp(buf, expected) == 0, test_desc); - return 0; + return exit_status(); } diff --git a/tests/ust-elf/prog.c b/tests/ust-elf/prog.c index 4036563a..e45ff845 100644 --- a/tests/ust-elf/prog.c +++ b/tests/ust-elf/prog.c @@ -165,5 +165,5 @@ int main(int argc, char **argv) AARCH64_BE_CRC); test_pic(test_dir); - return EXIT_SUCCESS; + return exit_status(); }