commit
a959deb007
@ -152,7 +152,7 @@ endfunction(glslang_set_link_args)
|
|||||||
# otherwise, it will find the wrong version and fail later
|
# otherwise, it will find the wrong version and fail later
|
||||||
if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
|
if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
|
||||||
find_package(PythonInterp 3 REQUIRED)
|
find_package(PythonInterp 3 REQUIRED)
|
||||||
|
|
||||||
# We depend on these for later projects, so they should come first.
|
# We depend on these for later projects, so they should come first.
|
||||||
add_subdirectory(External)
|
add_subdirectory(External)
|
||||||
endif()
|
endif()
|
||||||
@ -181,3 +181,26 @@ if(ENABLE_HLSL)
|
|||||||
add_subdirectory(hlsl)
|
add_subdirectory(hlsl)
|
||||||
endif(ENABLE_HLSL)
|
endif(ENABLE_HLSL)
|
||||||
add_subdirectory(gtests)
|
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()
|
||||||
|
|
||||||
|
if (CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults)
|
||||||
|
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/glslangValidator)
|
||||||
|
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/spirv-remap)
|
||||||
|
else(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
|
||||||
|
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
|
||||||
|
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
|
||||||
|
endif(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
|
||||||
|
add_test(NAME glslang-testsuite
|
||||||
|
COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Test/)
|
||||||
|
endif(BUILD_TESTING)
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
TARGETDIR=localResults
|
# Arguments:
|
||||||
|
# 1- TargetDirectory, where to write test results and intermediary files
|
||||||
|
# 2- Path to glslangValidator
|
||||||
|
# 3- Path to spirv-remap
|
||||||
|
|
||||||
|
TARGETDIR=${1:-localResults}
|
||||||
BASEDIR=baseResults
|
BASEDIR=baseResults
|
||||||
EXE=../build/install/bin/glslangValidator
|
EXE=${2:-../build/install/bin/glslangValidator}
|
||||||
REMAPEXE=../build/install/bin/spirv-remap
|
REMAPEXE=${3:-../build/install/bin/spirv-remap}
|
||||||
HASERROR=0
|
HASERROR=0
|
||||||
mkdir -p localResults
|
mkdir -p $TARGETDIR
|
||||||
|
|
||||||
if [ -a localtestlist ]
|
if [ -a localtestlist ]
|
||||||
then
|
then
|
||||||
@ -55,13 +60,13 @@ diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASER
|
|||||||
# multi-threaded test
|
# multi-threaded test
|
||||||
#
|
#
|
||||||
echo Comparing single thread to multithread for all tests in current directory...
|
echo Comparing single thread to multithread for all tests in current directory...
|
||||||
$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > singleThread.out
|
$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > $TARGETDIR/singleThread.out
|
||||||
$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > multiThread.out
|
$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > $TARGETDIR/multiThread.out
|
||||||
diff singleThread.out multiThread.out || HASERROR=1
|
diff $TARGETDIR/singleThread.out $TARGETDIR/multiThread.out || HASERROR=1
|
||||||
if [ $HASERROR -eq 0 ]
|
if [ $HASERROR -eq 0 ]
|
||||||
then
|
then
|
||||||
rm singleThread.out
|
rm $TARGETDIR/singleThread.out
|
||||||
rm multiThread.out
|
rm $TARGETDIR/multiThread.out
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user