[Piglit] [PATCH 1/2] cl-program-tester: Initialize piglit_result to PIGLIT_SKIP

Tom Stellard tom at stellard.net
Wed Jun 26 15:53:14 PDT 2013


From: Tom Stellard <thomas.stellard at amd.com>

We were initializing it PIGLIT_PASS which meant that 'skipped' tests were
being reported as 'pass'.
---
 tests/cl/program/program-tester.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
index 21ea848..ae2fc9e 100644
--- a/tests/cl/program/program-tester.c
+++ b/tests/cl/program/program-tester.c
@@ -1933,7 +1933,7 @@ piglit_cl_test(const int argc,
                const struct piglit_cl_program_test_config* config,
                const struct piglit_cl_program_test_env* env)
 {
-	enum piglit_result result = PIGLIT_PASS;
+	enum piglit_result result = PIGLIT_SKIP;
 
 	int i;
 
@@ -1944,6 +1944,14 @@ piglit_cl_test(const int argc,
 		printf("Program has failed to build as expected\n");
 	}
 
+	/* If num_tests is 0, then we are running a build test and the fact
+	 * that we have made it this far means that the program has built
+	 * successfully, so we can report PIGLIT_PASS.
+	 */
+	if (num_tests == 0) {
+		result = PIGLIT_PASS;
+	}
+
 	/* Run the tests */
 	for(i = 0; i< num_tests; i++) {
 		enum piglit_result test_result;
-- 
1.7.11.4



More information about the Piglit mailing list