glsl-1.10: test mesa bug conflict between globals
[piglit.git] / tests / sanity.py
blob663edc4b0aabf578abd4d5be73b578f1ae15f277
1 # encoding=utf-8
2 # Copyright © 2018 Intel Corporation
4 # Permission is hereby granted, free of charge, to any person obtaining a copy
5 # of this software and associated documentation files (the "Software"), to deal
6 # in the Software without restriction, including without limitation the rights
7 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 # copies of the Software, and to permit persons to whom the Software is
9 # furnished to do so, subject to the following conditions:
11 # The above copyright notice and this permission notice shall be included in
12 # all copies or substantial portions of the Software.
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 # SOFTWARE.
22 """A minimal profile that aims to touch test most major OpenGL features with as
23 few tests as possible.
25 This is largely aimed at bring up of a new driver or a driver on new hardware,
26 where performance and stability are not necessarily the best. The idea is to
27 touch the main functionality of important features without running for too
28 long. This *will* miss many corner cases, that's okay. For more stable
29 hardware or software stacks the "gpu" or "quick" profiles are probably more
30 appropriate.
31 """
33 import os
35 from framework import grouptools
36 from framework.profile import TestProfile
37 from framework.test import PiglitGLTest
38 from framework.test.shader_test import ShaderTest
39 from .py_modules.constants import GENERATED_TESTS_DIR, TESTS_DIR
41 __all__ = ['profile']
43 basepath = os.path.normpath(os.path.join(TESTS_DIR, '..'))
44 gen_basepath = os.path.relpath(os.path.join(GENERATED_TESTS_DIR, '..'), basepath)
47 def add_shader_test(shader):
48 """Given an adder, creates a group and adds a shader test."""
49 for d in (TESTS_DIR, GENERATED_TESTS_DIR,):
50 s = os.path.abspath(os.path.join(d, shader))
51 if os.path.exists(s):
52 basedir = d
53 abs_path = s
54 break
56 dirpath, filename = os.path.split(os.path.join(basedir, shader))
57 dirname = os.path.relpath(dirpath, basepath)
58 filepath = os.path.join(dirname, filename)
60 if os.path.commonprefix([abs_path, GENERATED_TESTS_DIR]) == GENERATED_TESTS_DIR:
61 installpath = os.path.relpath(filepath, gen_basepath)
62 else:
63 installpath = None
65 groupname = grouptools.from_path(os.path.relpath(dirpath, basedir))
66 testname = os.path.splitext(os.path.basename(shader))[0]
67 group = grouptools.join(groupname, testname)
68 profile.test_list[group] = ShaderTest.new(filepath, installpath)
71 profile = TestProfile()
73 shader_tests = (
74 'fast_color_clear/all-colors.shader_test',
75 'spec/arb_texture_gather/execution/miplevels.shader_test',
76 'spec/glsl-1.10/execution/algebraic/glsl-algebraic-add-zero.shader_test',
77 'spec/glsl-1.10/execution/derivatives/glsl-derivs-varyings.shader_test',
78 'spec/glsl-1.10/execution/builtins/glsl-fs-max-3.shader_test',
79 'spec/glsl-1.10/execution/samplers/glsl-fs-texture2d-branching.shader_test',
80 'spec/glsl-1.10/execution/glsl-vs-mat-mul-1.shader_test',
81 'spec/amd_shader_trinary_minmax/execution/built-in-functions/cs-max3-uvec4-uvec4-uvec4.shader_test',
82 'spec/amd_shader_trinary_minmax/execution/built-in-functions/tcs-max3-vec4-vec4-vec4.shader_test',
83 'spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index.shader_test',
84 'spec/arb_arrays_of_arrays/execution/sampler/vs-struct-nonconst.shader_test',
85 'spec/arb_compute_shader/execution/basic-ssbo.shader_test',
86 'spec/arb_compute_shader/execution/shared-atomics.shader_test',
87 'spec/arb_derivative_control/execution/dfdx-dfdy.shader_test',
88 'spec/arb_gpu_shader5/execution/built-in-functions/fs-bitfieldReverse.shader_test',
89 'spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-distance-dvec4-dvec4.shader_test',
90 'spec/arb_gpu_shader_int64/execution/built-in-functions/cs-op-div-i64vec4-i64vec4.shader_test',
91 'spec/arb_shader_ballot/execution/fs-readFirstInvocation-uint-loop.shader_test',
92 'spec/arb_shader_group_vote/cs-all.shader_test',
93 'spec/arb_shader_image_load_store/execution/write-to-rendered-image.shader_test',
94 'spec/arb_shader_precision/gs-op-div-vec4-vec4.shader_test',
95 'spec/arb_shader_subroutine/execution/two-subroutines-nested.shader_test',
96 'spec/arb_shader_texture_lod/execution/glsl-fs-shadow2DGradARB-cumulative.shader_test',
97 'spec/arb_tessellation_shader/execution/barrier-patch.shader_test',
98 'spec/arb_tessellation_shader/execution/built-in-functions/tcs-any-bvec4-using-if.shader_test',
99 'spec/arb_tessellation_shader/execution/sanity.shader_test',
100 'spec/arb_vertex_attrib_64bit/execution/vs_in/vs-input-uint_uvec4-double_dmat3x4_array2-position.shader_test',
101 'spec/glsl-1.50/execution/geometry-basic.shader_test',
102 'spec/oes_viewport_array/viewport-gs-write-simple.shader_test',
105 for shader_test in shader_tests:
106 add_shader_test(shader_test)
108 with profile.test_list.group_manager(
109 PiglitGLTest,
110 grouptools.join('spec', 'glsl-1.50')) as g:
111 g(['glsl-1.50-transform-feedback-builtins'], 'transform-feedback-builtins')