spirv: Add skip_os_break_in_debug_build option to use in unit tests
authorCaio Oliveira <caio.oliveira@intel.com>
Fri, 24 Feb 2023 03:24:24 +0000 (19:24 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 1 Mar 2023 13:47:57 +0000 (13:47 +0000)
commit5f79e78911028240084934795a71c720c7a90dcd
treebd5a765dea0b71c7582a520020f8a3ab8b096cdd
parent8a91a33b7cc1991a0a232444f232eeb00b18b502
spirv: Add skip_os_break_in_debug_build option to use in unit tests

When running in the CI environment, instead of crashing the test
binary, it is preferable to just fail gracefully (in this case return
a NULL shader) like is done in release mode, so other tests continue
to be executed.

For convenience add a variable break_on_failure to the test so the
breaking behavior can be re-enable in individual tests when debugging.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
src/compiler/spirv/nir_spirv.h
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/tests/helpers.h