Make runtests configurable.

This CL allows setting the location of glslangValidator and spirv-remap
when calling the runtests script. A test target is added to CMake to
execute runtests and sets the location to the build folder for the two
applications.
This commit is contained in:
Dan Sinclair 2019-10-15 15:21:21 -04:00
parent b03e4fc4e0
commit 167201430d
2 changed files with 20 additions and 2 deletions

View File

@ -180,3 +180,21 @@ if(ENABLE_HLSL)
add_subdirectory(hlsl)
endif(ENABLE_HLSL)
add_subdirectory(gtests)
if(BUILD_TESTING)
# glslang-testsuite runs a bash script on Windows.
# Make sure to use '-o igncr' flag to ignore carriage returns (\r).
set(IGNORE_CR_FLAG "")
if(WIN32)
set(IGNORE_CR_FLAG -o igncr)
endif()
add_test(NAME glslang-testsuite
COMMAND bash ${IGNORE_CR_FLAG} runtests
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Test/)
set_property(TEST glslang-testsuite APPEND PROPERTY
ENVIRONMENT GLSLANG_PATH=${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
set_property(TEST glslang-testsuite APPEND PROPERTY
ENVIRONMENT SPIRV_REMAP_PATH=${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
endif(BUILD_TESTING)

View File

@ -2,8 +2,8 @@
TARGETDIR=localResults
BASEDIR=baseResults
EXE=../build/install/bin/glslangValidator
REMAPEXE=../build/install/bin/spirv-remap
EXE=${GLSLANG_PATH:-../build/install/bin/glslangValidator}
REMAPEXE=${SPIRV_REMAP_PATH:-../build/install/bin/spirv-remap}
HASERROR=0
mkdir -p localResults