mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add test for thread unit
Add test as part of Thread UT to increase the branch coverage. Jira NVGPU-4478 Change-Id: I774e9677fde51d33505081d33193c93ef25617a9 Signed-off-by: ajesh <akv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2291448 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com> Reviewed-by: Philip Elcan <pelcan@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
@@ -50,6 +50,10 @@ static int test_thread_fn(void *args)
|
||||
}
|
||||
}
|
||||
|
||||
if (data->use_return) {
|
||||
return (data->use_return);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -76,6 +80,9 @@ int test_thread_cycle(struct unit_module *m, struct gk20a *g, void *args)
|
||||
|
||||
if (test_args->use_priority == false) {
|
||||
if (test_args->use_name == true) {
|
||||
if (test_args->ret_err == true) {
|
||||
test_data.use_return = 1;
|
||||
}
|
||||
ret = nvgpu_thread_create(&test_thread, &test_data,
|
||||
test_thread_fn,
|
||||
"test_thread");
|
||||
@@ -156,6 +163,7 @@ int test_thread_cycle(struct unit_module *m, struct gk20a *g, void *args)
|
||||
struct unit_module_test posix_thread_tests[] = {
|
||||
UNIT_TEST(create, test_thread_cycle, &create_normal, 0),
|
||||
UNIT_TEST(create_noname, test_thread_cycle, &create_normal_noname, 0),
|
||||
UNIT_TEST(create_noname_errret, test_thread_cycle, &create_normal_errret, 0),
|
||||
UNIT_TEST(create_priority, test_thread_cycle, &create_priority, 0),
|
||||
UNIT_TEST(create_priority_noname, test_thread_cycle, &create_priority_noname, 0),
|
||||
UNIT_TEST(cycle, test_thread_cycle, &check_stop, 0),
|
||||
|
||||
Reference in New Issue
Block a user