From 57b0be86471f4356b912d5976e4f5b9cb9e92220 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 1 Apr 2019 15:39:02 +0200 Subject: [PATCH] tests: skip auto-shader tests if Cg shaders are not supported --- tests/display/test_color_buffer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/display/test_color_buffer.py b/tests/display/test_color_buffer.py index d95913b0f7..bb2bf3deb1 100644 --- a/tests/display/test_color_buffer.py +++ b/tests/display/test_color_buffer.py @@ -105,6 +105,12 @@ def render_color_pixel(region, state, vertex_color=None): """Renders a fragment using the specified render settings, and returns the resulting color value.""" + # Skip auto-shader tests if we don't support Cg shaders. + if not region.window.gsg.supports_basic_shaders: + sattr = state.get_attrib(core.ShaderAttrib) + if sattr and sattr.auto_shader(): + pytest.skip("Cannot test auto-shader without Cg shader support") + # Set up the scene with a blank card rendering at specified distance. scene = core.NodePath("root") scene.set_attrib(core.DepthTestAttrib.make(core.RenderAttrib.M_always))