From de1edcc1ee015c221cbca308d2d0b701de3f772c Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Mon, 22 Apr 2019 13:58:12 -0400 Subject: [PATCH] gpu: nvgpu: unit: fix pass calculation for L1 tests Fix the pass/fail verdict caldulation for the main() return value and the nvtest print out. They were not considering the skipped tests. JIRA NVGPU-3200 Change-Id: I4383cff4ef864c49f072299ad2f38a94ca1f5230 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2103514 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/src/exec.c | 3 ++- userspace/src/unit_main.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/userspace/src/exec.c b/userspace/src/exec.c index 423bd0cec..d45afa369 100644 --- a/userspace/src/exec.c +++ b/userspace/src/exec.c @@ -222,7 +222,8 @@ int core_exec(struct unit_fw *fw) if (args(fw)->nvtest) { /* special prints for NVTEST fw in GVS */ printf("[%s: %s]\n", - fw->results->nr_tests == fw->results->nr_passing ? + ((fw->results->nr_tests - fw->results->nr_passing - + fw->results->nr_skipped) == 0) ? "pass" : "fail", args(fw)->binary_name); } diff --git a/userspace/src/unit_main.c b/userspace/src/unit_main.c index e1c25e3d5..4cedae4cd 100644 --- a/userspace/src/unit_main.c +++ b/userspace/src/unit_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -77,7 +77,8 @@ int main(int argc, char **argv) core_print_test_status(fw); - if ((fw->results->nr_tests - fw->results->nr_passing) != 0) { + if ((fw->results->nr_tests - fw->results->nr_passing - + fw->results->nr_skipped) != 0) { /* Some tests failed */ return -1; }