Commit 29cc2458 by Antonio Maiorano

Kokoro: build and run rr::Print unit tests

After the normal build and unit tests run, incrementally build ReactorUnitTests with REACTOR_ENABLE_PRINT enabled, and run only the unit tests that exercise the print code. This should add very little extra time to our Kokoro builds, while ensuring we don't break the rr::Print stuff. Bug: b/149328074 Change-Id: I26c0db727c8edd269243f17192020a3435893c14 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41148 Presubmit-Ready: Antonio Maiorano <amaiorano@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 415d1815
......@@ -543,6 +543,13 @@ else()
endif()
endif()
if((${REACTOR_BACKEND} STREQUAL "Subzero") AND (REACTOR_ENABLE_PRINT OR REACTOR_EMIT_PRINT_LOCATION OR REACTOR_EMIT_DEBUG_INFO))
message(WARNING "REACTOR_ENABLE_PRINT, REACTOR_EMIT_PRINT_LOCATION, and REACTOR_EMIT_DEBUG_INFO are not supported by Subzero, disabling.")
set(REACTOR_ENABLE_PRINT "Off")
set(REACTOR_EMIT_PRINT_LOCATION "Off")
set(REACTOR_EMIT_DEBUG_INFO "Off")
endif()
if(REACTOR_EMIT_PRINT_LOCATION)
# This feature depends on REACTOR_EMIT_DEBUG_INFO and REACTOR_ENABLE_PRINT
set(REACTOR_EMIT_DEBUG_INFO "On")
......
......@@ -24,7 +24,7 @@ fi
LESS_DEBUG_INFO=1
cmake .. "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1" "-DLESS_DEBUG_INFO=${LESS_DEBUG_INFO}"
make --jobs=$(nproc)
cmake --build . -- -j $(nproc)
# Run unit tests
......@@ -32,4 +32,11 @@ cd .. # Some tests must be run from project root
build/ReactorUnitTests
build/gles-unittests
build/vk-unittests
\ No newline at end of file
build/vk-unittests
# Incrementally build and run rr::Print unit tests
cd build
cmake .. "-DREACTOR_ENABLE_PRINT=1"
cmake --build . --target ReactorUnitTests -- -j $(nproc)
cd ..
build/ReactorUnitTests --gtest_filter=ReactorUnitTests.Print*
......@@ -14,16 +14,13 @@ if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
# Lower the amount of debug info, to reduce Kokoro build times.
SET LESS_DEBUG_INFO=1
SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild"
SET CONFIG=Debug
cd %SRC%\build
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
cmake .. -G "Visual Studio 15 2017 Win64" -Thost=x64 "-DCMAKE_BUILD_TYPE=%BUILD_TYPE%" "-DREACTOR_BACKEND=%REACTOR_BACKEND%" "-DREACTOR_VERIFY_LLVM_IR=1" "-DLESS_DEBUG_INFO=%LESS_DEBUG_INFO%"
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
%MSBUILD% /p:Configuration=%CONFIG% SwiftShader.sln
cmake --build .
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
REM Run the unit tests. Some must be run from project root
......@@ -38,4 +35,21 @@ build\Debug\gles-unittests.exe
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
build\Debug\vk-unittests.exe
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
\ No newline at end of file
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
Rem Incrementally build and run rr::Print unit tests
cd %SRC%\build
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
cmake "-DREACTOR_ENABLE_PRINT=1" ..
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
cmake --build . --target ReactorUnitTests
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
cd %SRC%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
SET SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG=1
build\Debug\ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.Print*
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
......@@ -26,7 +26,7 @@ if [[ "${BUILD_TYPE}" == "Debug" ]]; then
fi
cmake .. "-DSWIFTSHADER_ASAN=${ASAN}" "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1" "-DLESS_DEBUG_INFO=${LESS_DEBUG_INFO}"
make -j$(sysctl -n hw.logicalcpu)
cmake --build . -- -j$(sysctl -n hw.logicalcpu)
# Run unit tests
......@@ -35,3 +35,10 @@ cd .. # Some tests must be run from project root
build/ReactorUnitTests
build/gles-unittests
build/vk-unittests
# Incrementally build and run rr::Print unit tests
cd build
cmake .. "-DREACTOR_ENABLE_PRINT=1"
cmake --build . --target ReactorUnitTests -- -j$(sysctl -n hw.logicalcpu)
cd ..
build/ReactorUnitTests --gtest_filter=ReactorUnitTests.Print*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment