[v2,13/19] tests/ext_transform_feedback-max-varyings: fix result reporting

Submitted by Dylan Baker on Dec. 3, 2018, 6:13 p.m.

Details

Message ID 20181203181358.12095-13-dylan@pnwbakers.com
State New
Headers show
Series "Convert a number of tests to use subtest framework" ( rev: 17 16 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker Dec. 3, 2018, 6:13 p.m.
Currently if the first subtest failed then the second subtest (AoA)
would always report fail, this is bad. Instead we want to report fail,
but leave status (which is set to warn in the implementation doesn't
meet certain assumptions by the test), so that the second test can
report accurately.
---
 tests/spec/ext_transform_feedback/max-varyings.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/ext_transform_feedback/max-varyings.c b/tests/spec/ext_transform_feedback/max-varyings.c
index b8c98a5d5..0d368cac7 100644
--- a/tests/spec/ext_transform_feedback/max-varyings.c
+++ b/tests/spec/ext_transform_feedback/max-varyings.c
@@ -416,10 +416,7 @@  piglit_display(void)
 	fs = get_fs(max_varyings);
 	pass = run_subtest(vs, fs, max_xfb_varyings,
 			   max_varyings, xfb_varying_array);
-	if (!pass) {
-		status = PIGLIT_FAIL;
-	}
-	piglit_report_subtest_result(status,
+	piglit_report_subtest_result(pass ? status : PIGLIT_FAIL,
 				     "max-varying-single-dimension-array");
 
 	/* Test arrays of arrays */
@@ -429,11 +426,8 @@  piglit_display(void)
 		fs = get_fs_aoa(max_varyings);
 		subtest_result = run_subtest(vs, fs, max_xfb_varyings,
 					     max_varyings, xfb_varying_aoa);
-		if (!subtest_result) {
-			status = PIGLIT_FAIL;
-			pass = false;
-		}
-		piglit_report_subtest_result(status,
+		pass &= subtest_result;
+		piglit_report_subtest_result(subtest_result ? status : PIGLIT_FAIL,
 					     "max-varying-arrays-of-arrays");
 	} else {
 		piglit_report_subtest_result(PIGLIT_SKIP,
@@ -441,7 +435,7 @@  piglit_display(void)
 	}
 	piglit_present_results();
 
-	return status;
+	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
 void piglit_init(int argc, char **argv)