[Piglit] [PATCH 4/4] generators: Add a simple generator for enabled and disabled defines
Ilia Mirkin
imirkin at alum.mit.edu
Tue Apr 12 15:08:46 UTC 2016
On Tue, Apr 12, 2016 at 3:49 AM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> +/* This is a generated test, do not edit
> + * Generated by gen_extensions_defined.py
> + *
> + * [config]
> + * expect_result: pass
> + * glsl_version: ${version.print_float()}
> + * require_extensions: !${extension} ${' '.join(extra_extensions)}
> + * [end config]
> + */
> +
> +#version ${str(version)}
> +% for ext in extra_extensions:
> + #extension ${ext} : require
> +% endfor
> +
> +#if defined ${extension}
> +# error ${extension} is defined, but should not be
> +#endif
> +
> +float foo() { return 0.0; }
[Let's try again, with trimming... stupid phone.]
This only tests for the extension being not defined. It doesn't test
for one still being able to enable the functionality with
#extension foo: require
You should add a second disabled test which verifies that this errors
out. (:enable and :warn will not error out if the ext isn't there).
Furthermore, if you want to be _really_ correct, various extensions
have various version requirements. One should ensure that they go away
when the #version goes too low. That may be excessive though.
-ilia
More information about the Piglit
mailing list