Kokoro: Split tests into Debug and RelWithDebInfo

Both code paths will be tested for Windows, macOS, Linux for both LLVM and Subzero backends.

Bug: b/145836207
Change-Id: I707b1551fe1a65549c47a6d7756ab94aeb8d80e2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39312
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
diff --git a/tests/kokoro/gcp_ubuntu/continuous.sh b/tests/kokoro/gcp_ubuntu/continuous.sh
index ffb48b8..56ac8df 100644
--- a/tests/kokoro/gcp_ubuntu/continuous.sh
+++ b/tests/kokoro/gcp_ubuntu/continuous.sh
@@ -25,7 +25,7 @@
   REACTOR_BACKEND="LLVM"
 fi
 
-cmake .. "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1"
+cmake .. "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1"
 make --jobs=$(nproc)
 
 # Run unit tests
diff --git a/tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_llvm/debug/continuous.cfg
similarity index 81%
rename from tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg
rename to tests/kokoro/gcp_ubuntu/reactor_llvm/debug/continuous.cfg
index a08f811..a4e64a9 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_llvm/debug/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_llvm/presubmit.cfg b/tests/kokoro/gcp_ubuntu/reactor_llvm/debug/presubmit.cfg
similarity index 81%
rename from tests/kokoro/gcp_ubuntu/reactor_llvm/presubmit.cfg
rename to tests/kokoro/gcp_ubuntu/reactor_llvm/debug/presubmit.cfg
index a08f811..a4e64a9 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_llvm/presubmit.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_llvm/debug/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_llvm/release/continuous.cfg
similarity index 78%
copy from tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg
copy to tests/kokoro/gcp_ubuntu/reactor_llvm/release/continuous.cfg
index a08f811..a12e96e 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_llvm/release/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_llvm/release/presubmit.cfg
similarity index 78%
copy from tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg
copy to tests/kokoro/gcp_ubuntu/reactor_llvm/release/presubmit.cfg
index a08f811..a12e96e 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_llvm/release/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_subzero/debug/continuous.cfg
similarity index 81%
rename from tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
rename to tests/kokoro/gcp_ubuntu/reactor_subzero/debug/continuous.cfg
index e67058e..bab15ae 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_subzero/debug/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_subzero/debug/presubmit.cfg
similarity index 81%
copy from tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
copy to tests/kokoro/gcp_ubuntu/reactor_subzero/debug/presubmit.cfg
index e67058e..bab15ae 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_subzero/debug/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_subzero/presubmit.cfg b/tests/kokoro/gcp_ubuntu/reactor_subzero/presubmit.cfg
deleted file mode 100644
index e67058e..0000000
--- a/tests/kokoro/gcp_ubuntu/reactor_subzero/presubmit.cfg
+++ /dev/null
@@ -1,9 +0,0 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
-# Location of the continuous bash script in Git.
-build_file: "SwiftShader/tests/kokoro/gcp_ubuntu/continuous.sh"
-
-env_vars {
-  key: "REACTOR_BACKEND"
-  value: "Subzero"
-}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_subzero/release/continuous.cfg
similarity index 78%
copy from tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
copy to tests/kokoro/gcp_ubuntu/reactor_subzero/release/continuous.cfg
index e67058e..6190da8 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_subzero/release/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_ubuntu/reactor_subzero/release/presubmit.cfg
similarity index 78%
copy from tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
copy to tests/kokoro/gcp_ubuntu/reactor_subzero/release/presubmit.cfg
index e67058e..6190da8 100644
--- a/tests/kokoro/gcp_ubuntu/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_ubuntu/reactor_subzero/release/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_windows/continuous.bat b/tests/kokoro/gcp_windows/continuous.bat
index aa3b925..450e5fa 100644
--- a/tests/kokoro/gcp_windows/continuous.bat
+++ b/tests/kokoro/gcp_windows/continuous.bat
@@ -17,7 +17,7 @@
 cd %SRC%\build
 if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
 
-cmake .. -G "Visual Studio 15 2017 Win64" -Thost=x64 "-DREACTOR_BACKEND=%REACTOR_BACKEND%" "-DREACTOR_VERIFY_LLVM_IR=1"
+cmake .. -G "Visual Studio 15 2017 Win64" -Thost=x64 "-DCMAKE_BUILD_TYPE=%BUILD_TYPE%" "-DREACTOR_BACKEND=%REACTOR_BACKEND%" "-DREACTOR_VERIFY_LLVM_IR=1"
 if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
 
 %MSBUILD% /p:Configuration=%CONFIG% SwiftShader.sln
diff --git a/tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg b/tests/kokoro/gcp_windows/reactor_llvm/debug/continuous.cfg
similarity index 81%
rename from tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg
rename to tests/kokoro/gcp_windows/reactor_llvm/debug/continuous.cfg
index e45a3a3..c21558f 100644
--- a/tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/gcp_windows/reactor_llvm/debug/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_llvm/presubmit.cfg b/tests/kokoro/gcp_windows/reactor_llvm/debug/presubmit.cfg
similarity index 81%
rename from tests/kokoro/gcp_windows/reactor_llvm/presubmit.cfg
rename to tests/kokoro/gcp_windows/reactor_llvm/debug/presubmit.cfg
index e45a3a3..c21558f 100644
--- a/tests/kokoro/gcp_windows/reactor_llvm/presubmit.cfg
+++ b/tests/kokoro/gcp_windows/reactor_llvm/debug/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg b/tests/kokoro/gcp_windows/reactor_llvm/release/continuous.cfg
similarity index 78%
copy from tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg
copy to tests/kokoro/gcp_windows/reactor_llvm/release/continuous.cfg
index e45a3a3..1e74f2e 100644
--- a/tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/gcp_windows/reactor_llvm/release/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg b/tests/kokoro/gcp_windows/reactor_llvm/release/presubmit.cfg
similarity index 78%
copy from tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg
copy to tests/kokoro/gcp_windows/reactor_llvm/release/presubmit.cfg
index e45a3a3..1e74f2e 100644
--- a/tests/kokoro/gcp_windows/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/gcp_windows/reactor_llvm/release/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_windows/reactor_subzero/debug/continuous.cfg
similarity index 81%
rename from tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg
rename to tests/kokoro/gcp_windows/reactor_subzero/debug/continuous.cfg
index e62e4e8..f29e096 100644
--- a/tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_windows/reactor_subzero/debug/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_subzero/presubmit.cfg b/tests/kokoro/gcp_windows/reactor_subzero/debug/presubmit.cfg
similarity index 81%
rename from tests/kokoro/gcp_windows/reactor_subzero/presubmit.cfg
rename to tests/kokoro/gcp_windows/reactor_subzero/debug/presubmit.cfg
index e62e4e8..f29e096 100644
--- a/tests/kokoro/gcp_windows/reactor_subzero/presubmit.cfg
+++ b/tests/kokoro/gcp_windows/reactor_subzero/debug/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_windows/reactor_subzero/release/continuous.cfg
similarity index 78%
copy from tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg
copy to tests/kokoro/gcp_windows/reactor_subzero/release/continuous.cfg
index e62e4e8..27403ed 100644
--- a/tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_windows/reactor_subzero/release/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg b/tests/kokoro/gcp_windows/reactor_subzero/release/presubmit.cfg
similarity index 78%
copy from tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg
copy to tests/kokoro/gcp_windows/reactor_subzero/release/presubmit.cfg
index e62e4e8..27403ed 100644
--- a/tests/kokoro/gcp_windows/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/gcp_windows/reactor_subzero/release/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/macos/continuous.sh b/tests/kokoro/macos/continuous.sh
index a5675c0..766942a 100755
--- a/tests/kokoro/macos/continuous.sh
+++ b/tests/kokoro/macos/continuous.sh
@@ -15,7 +15,7 @@
   REACTOR_BACKEND="LLVM"
 fi
 
-cmake .. "-DASAN=ON" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DREACTOR_VERIFY_LLVM_IR=1"
+cmake .. "-DASAN=ON" "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1"
 make -j$(sysctl -n hw.logicalcpu)
 
 # Run unit tests
diff --git a/tests/kokoro/macos/reactor_llvm/continuous.cfg b/tests/kokoro/macos/reactor_llvm/debug/continuous.cfg
similarity index 80%
rename from tests/kokoro/macos/reactor_llvm/continuous.cfg
rename to tests/kokoro/macos/reactor_llvm/debug/continuous.cfg
index 6c1b0f0..941d08d 100644
--- a/tests/kokoro/macos/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/macos/reactor_llvm/debug/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/macos/reactor_llvm/continuous.cfg b/tests/kokoro/macos/reactor_llvm/debug/presubmit.cfg
similarity index 80%
copy from tests/kokoro/macos/reactor_llvm/continuous.cfg
copy to tests/kokoro/macos/reactor_llvm/debug/presubmit.cfg
index 6c1b0f0..941d08d 100644
--- a/tests/kokoro/macos/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/macos/reactor_llvm/debug/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/macos/reactor_llvm/continuous.cfg b/tests/kokoro/macos/reactor_llvm/release/continuous.cfg
similarity index 78%
copy from tests/kokoro/macos/reactor_llvm/continuous.cfg
copy to tests/kokoro/macos/reactor_llvm/release/continuous.cfg
index 6c1b0f0..02e6206 100644
--- a/tests/kokoro/macos/reactor_llvm/continuous.cfg
+++ b/tests/kokoro/macos/reactor_llvm/release/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/macos/reactor_llvm/presubmit.cfg b/tests/kokoro/macos/reactor_llvm/release/presubmit.cfg
similarity index 78%
rename from tests/kokoro/macos/reactor_llvm/presubmit.cfg
rename to tests/kokoro/macos/reactor_llvm/release/presubmit.cfg
index 6c1b0f0..02e6206 100644
--- a/tests/kokoro/macos/reactor_llvm/presubmit.cfg
+++ b/tests/kokoro/macos/reactor_llvm/release/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "LLVM"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/macos/reactor_subzero/continuous.cfg b/tests/kokoro/macos/reactor_subzero/debug/continuous.cfg
similarity index 81%
rename from tests/kokoro/macos/reactor_subzero/continuous.cfg
rename to tests/kokoro/macos/reactor_subzero/debug/continuous.cfg
index fe437b4..ccfab85 100644
--- a/tests/kokoro/macos/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/macos/reactor_subzero/debug/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/macos/reactor_subzero/presubmit.cfg b/tests/kokoro/macos/reactor_subzero/debug/presubmit.cfg
similarity index 81%
rename from tests/kokoro/macos/reactor_subzero/presubmit.cfg
rename to tests/kokoro/macos/reactor_subzero/debug/presubmit.cfg
index fe437b4..ccfab85 100644
--- a/tests/kokoro/macos/reactor_subzero/presubmit.cfg
+++ b/tests/kokoro/macos/reactor_subzero/debug/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "Debug"
+}
diff --git a/tests/kokoro/macos/reactor_subzero/continuous.cfg b/tests/kokoro/macos/reactor_subzero/release/continuous.cfg
similarity index 78%
copy from tests/kokoro/macos/reactor_subzero/continuous.cfg
copy to tests/kokoro/macos/reactor_subzero/release/continuous.cfg
index fe437b4..5575aa7 100644
--- a/tests/kokoro/macos/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/macos/reactor_subzero/release/continuous.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}
diff --git a/tests/kokoro/macos/reactor_subzero/continuous.cfg b/tests/kokoro/macos/reactor_subzero/release/presubmit.cfg
similarity index 78%
copy from tests/kokoro/macos/reactor_subzero/continuous.cfg
copy to tests/kokoro/macos/reactor_subzero/release/presubmit.cfg
index fe437b4..5575aa7 100644
--- a/tests/kokoro/macos/reactor_subzero/continuous.cfg
+++ b/tests/kokoro/macos/reactor_subzero/release/presubmit.cfg
@@ -7,3 +7,8 @@
   key: "REACTOR_BACKEND"
   value: "Subzero"
 }
+
+env_vars {
+  key: "BUILD_TYPE"
+  value: "RelWithDebInfo"
+}