From c6eae929fd74f11ab13d469a38bffd4e8ba50fb5 Mon Sep 17 00:00:00 2001 From: Nicolas Benech Date: Tue, 25 Sep 2018 14:37:16 -0400 Subject: gpu: nvgpu: posix: Multithreading for unit tests Add a -j argument to enable running unit tests on several threads. Also adds signal handling to prevent a fatal error in one thread from killing the whole unit test framework. JIRA NVGPU-1043 Change-Id: I891a547640cd005a50ffa5c06367ed46c54de012 Signed-off-by: Nicolas Benech Reviewed-on: https://git-master.nvidia.com/r/1847740 Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/src/unit_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'userspace/src/unit_main.c') diff --git a/userspace/src/unit_main.c b/userspace/src/unit_main.c index 31c31d50..64344bf0 100644 --- a/userspace/src/unit_main.c +++ b/userspace/src/unit_main.c @@ -72,5 +72,13 @@ int main(int argc, char **argv) core_print_test_status(fw); + if (fw->results->nr_tests == 0) { + /* No tests were run */ + return -1; + } else if ((fw->results->nr_tests - fw->results->nr_passing) != 0) { + /* Some tests failed */ + return -1; + } + return 0; } -- cgit v1.2.2