Skip to content

BasicShaderTestSuite: Rework so each shader reports its own result #350

Description

@YYDan

Description

BasicShaderTestSuite was never covered by the summer 2024 refactor campaign, and it does not fit the standard split pattern — it needs investigation before any work is committed to.

The suite is 1,194 lines reporting 21 results, but the assert count is misleading: most facts contain a single assert_ call inside a loop over a shared shaders[] array. So shader_get/set_uniform_f (83 lines), shader_set_uniform_f_array (75 lines), shader_set_uniform_f_buffer (88 lines), shader_set_uniform_i (79 lines), shader_set_uniform_i_array (74 lines) and shader_get_sampler_index (69 lines) each report one pass/fail for what is actually one check per shader in the array. Two further facts, normals_test (76 lines) and gl_front_facing/sv_is_front_face (79 lines), contain no direct asserts at all and verify through helpers.

The right shape here is almost certainly addTheory() over the shader list rather than a flat fact split — that would give one reported result per shader per uniform function, which is what we actually want, without duplicating the loop body.

The two helper-based facts need a separate decision about how their verification should surface as a result.

This issue should start with an investigation and a written proposal, not with edits.

Script Name

BasicShaderTestSuite

Steps To The Task

  • Audit the suite and document how many distinct checks are actually performed behind each of the 21 reported results
  • Evaluate addTheory() over the shaders[] array as the primary approach and post the proposal on this issue for review before starting
  • Decide how normals_test and gl_front_facing/sv_is_front_face should report, given they verify through helpers rather than direct asserts
  • Implement the agreed approach
  • Add section comment headers per uniform family
  • Run the suite on VM and YYC across all supported shader languages and confirm the same set of checks pass as before

Metadata

Metadata

Assignees

Labels

refactorAn improvement to existing test/module code

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions