summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2018-01-17 15:27:24 -0700
committerBrian Paul <brianp@vmware.com>2018-01-18 16:36:16 -0700
commitbc996c660946e632588bccbf448ab1fdb270b656 (patch)
tree700b6c318149fda76c0652caa69754e44ab31545
parentd7bc75f18f0ccbaedfcdb0d2fcda44866a3d6acc (diff)
gl-1.0-blend-func: add --quick option
The test normally runs about 27,000 tests and takes quite a long time with some drivers. With the --quick option, only 5% of the tests are run. And update tests/quick.py to run the test with --quick. v2: test 5% instead of only 1% Reviewed-by: Roland Scheidegger <sroland@vmware.com>
-rw-r--r--tests/quick.py7
-rw-r--r--tests/spec/gl-1.0/blend.c23
2 files changed, 25 insertions, 5 deletions
diff --git a/tests/quick.py b/tests/quick.py
index 53774e4db..73c467852 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -68,6 +68,13 @@ with profile.test_list.group_manager(
with profile.test_list.allow_reassignment:
g(['ext_texture_env_combine-combine', '--quick'], 'texture-env-combine')
+# Set the --quick flag on the gl-1.0 blending test
+with profile.test_list.group_manager(
+ PiglitGLTest,
+ grouptools.join('spec', '!opengl 1.0')) as g:
+ with profile.test_list.allow_reassignment:
+ g(['gl-1.0-blend-func', '--quick'], 'gl-1.0-blend-func')
+
# Limit texture size to 512x512 for some texture_multisample tests.
# The default (max supported size) can be pretty slow.
with profile.test_list.group_manager(
diff --git a/tests/spec/gl-1.0/blend.c b/tests/spec/gl-1.0/blend.c
index c1796a5e5..3c6a793e7 100644
--- a/tests/spec/gl-1.0/blend.c
+++ b/tests/spec/gl-1.0/blend.c
@@ -64,6 +64,8 @@
#define HUGE_STEP 1000
+static int test_stride = 1;
+
/*
* We will check each pair of blend factors
* for each pixel in a square image of this
@@ -187,6 +189,13 @@ piglit_init(int argc, char **argv)
const char* blend_rgb_tol = getenv("PIGLIT_BLEND_RGB_TOLERANCE");
const char* blend_alpha_tol = getenv("PIGLIT_BLEND_ALPHA_TOLERANCE");
+ if (argc > 1 && strcmp(argv[1], "--quick") == 0) {
+ /* By default we run 27552 tests which is time consuming.
+ * With --quick we run only 1/20 (5%) of the tests.
+ */
+ test_stride = 20;
+ }
+
/*
* Hack: Make driver tests on incorrect hardware feasible
* We want to be able to perform meaningful tests
@@ -691,6 +700,7 @@ run_all_factor_sets(void)
bool pass = true;
int gl_version = piglit_get_gl_version();
int counter = 0; /* Number of tests we have done. */
+ int test_number = 0;
int step;
int op, opa;
int sf, sfa, df, dfa;
@@ -788,11 +798,14 @@ run_all_factor_sets(void)
for (dfa = 0; dfa <
num_dst_factors_sep;
dfa += step) {
- pass &= proc_factors(
- sf, sfa,
- df, dfa,
- &counter,
- op, opa);
+ if (test_number % test_stride == 0) {
+ pass &= proc_factors(
+ sf, sfa,
+ df, dfa,
+ &counter,
+ op, opa);
+ }
+ test_number++;
}
}
}