Move TARGETDIR as well
authorDan Sinclair <dsinclair@google.com>
Tue, 15 Oct 2019 20:47:28 +0000 (16:47 -0400)
committerDan Sinclair <dsinclair@google.com>
Tue, 15 Oct 2019 20:47:28 +0000 (16:47 -0400)
CMakeLists.txt
Test/runtests

index c3308e8..c5a4f67 100644 (file)
@@ -197,4 +197,12 @@ if(BUILD_TESTING)
     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)
+
+  if (CMAKE_CONFIGURATION_TYPES)
+    set_property(TEST glslang-testsuite APPEND PROPERTY
+      ENVIRONMENT GLSLANG_TEST_RESULTS=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults)
+  else(CMAKE_CONFIGURATION_TYPES)
+    set_property(TEST glslang-testsuite APPEND PROPERTY
+      ENVIRONMENT GLSLANG_TEST_RESULTS=${CMAKE_CURRENT_BINARY_DIR}/localResults)
+  endif(CMAKE_CONFIGURATION_TYPES)
 endif(BUILD_TESTING)
index 40e928b..3f624f7 100755 (executable)
@@ -1,11 +1,11 @@
 #!/usr/bin/env bash
 
-TARGETDIR=localResults
+TARGETDIR=${GLSLANG_TEST_RESULTS:-localResults}
 BASEDIR=baseResults
 EXE=${GLSLANG_PATH:-../build/install/bin/glslangValidator}
 REMAPEXE=${SPIRV_REMAP_PATH:-../build/install/bin/spirv-remap}
 HASERROR=0
-mkdir -p localResults
+mkdir -p $TARGETDIR
 
 if [ -a localtestlist ]
   then
@@ -55,13 +55,13 @@ diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASER
 # multi-threaded test
 #
 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 -t > multiThread.out
-diff singleThread.out multiThread.out || HASERROR=1
+$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp > $TARGETDIR/singleThread.out
+$EXE -i -C *.vert *.geom *.frag *.tesc *.tese *.comp -t > $TARGETDIR/multiThread.out
+diff $TARGETDIR/singleThread.out $TARGETDIR/multiThread.out || HASERROR=1
 if [ $HASERROR -eq 0 ]
 then
-    rm singleThread.out
-    rm multiThread.out
+    rm $TARGETDIR/singleThread.out
+    rm $TARGETDIR/multiThread.out
 fi
 
 #