summaryrefslogtreecommitdiffstats
path: root/userspace/src/unit_main.c
diff options
context:
space:
mode:
authorNicolas Benech <nbenech@nvidia.com>2018-09-25 14:37:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-27 17:04:17 -0400
commitc6eae929fd74f11ab13d469a38bffd4e8ba50fb5 (patch)
tree12525d29aa8934cba58c703e67bf1aa8928ccacd /userspace/src/unit_main.c
parent442cb2b1db40ae23bbcfda0624c0546da186694c (diff)
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 <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1847740 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'userspace/src/unit_main.c')
-rw-r--r--userspace/src/unit_main.c8
1 files changed, 8 insertions, 0 deletions
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)
72 72
73 core_print_test_status(fw); 73 core_print_test_status(fw);
74 74
75 if (fw->results->nr_tests == 0) {
76 /* No tests were run */
77 return -1;
78 } else if ((fw->results->nr_tests - fw->results->nr_passing) != 0) {
79 /* Some tests failed */
80 return -1;
81 }
82
75 return 0; 83 return 0;
76} 84}