Skip to content

Commit

Permalink
Kokoro: Enable debug checks
Browse files Browse the repository at this point in the history
Enabled `MARL_FATAL` and `MARL_ASSERT` even in debug builds.
  • Loading branch information
ben-clayton committed Jun 5, 2020
1 parent 4e30d55 commit 56fc2b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ option_if_not_defined(MARL_MSAN "Build marl with memory sanitizer" OFF)
option_if_not_defined(MARL_TSAN "Build marl with thread sanitizer" OFF)
option_if_not_defined(MARL_INSTALL "Create marl install target" OFF)
option_if_not_defined(MARL_FULL_BENCHMARK "Benchmark all cores and a range of tasks" OFF)
option_if_not_defined(MARL_DEBUG_ENABLED "Enable debug checks even in release builds" OFF)

###########################################################
# Directories
Expand Down Expand Up @@ -187,6 +188,10 @@ function(marl_set_target_options target)
target_link_libraries(${target} PUBLIC "-fsanitize=thread")
endif()

if (MARL_DEBUG_ENABLED)
target_compile_definitions(${target} PRIVATE "MARL_DEBUG_ENABLED=1")
endif()

target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${MARL_INCLUDE_DIR}>)
endfunction(marl_set_target_options)

Expand Down
7 changes: 6 additions & 1 deletion kokoro/macos/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ if [ "$BUILD_SYSTEM" == "cmake" ]; then
mkdir build
cd build

cmake .. -DMARL_BUILD_EXAMPLES=1 -DMARL_BUILD_TESTS=1 -DMARL_BUILD_BENCHMARKS=1 -DMARL_WARNINGS_AS_ERRORS=1
cmake .. -DMARL_BUILD_EXAMPLES=1 \
-DMARL_BUILD_TESTS=1 \
-DMARL_BUILD_BENCHMARKS=1 \
-DMARL_WARNINGS_AS_ERRORS=1 \
-DMARL_DEBUG_ENABLED=1

make -j$(sysctl -n hw.logicalcpu)

./marl-unittests
Expand Down
3 changes: 2 additions & 1 deletion kokoro/ubuntu/presubmit-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ if [ "$BUILD_SYSTEM" == "cmake" ]; then
-DMARL_BUILD_EXAMPLES=1 \
-DMARL_BUILD_TESTS=1 \
-DMARL_BUILD_BENCHMARKS=1 \
-DMARL_WARNINGS_AS_ERRORS=1
-DMARL_WARNINGS_AS_ERRORS=1 \
-DMARL_DEBUG_ENABLED=1

make --jobs=$(nproc)

Expand Down
2 changes: 1 addition & 1 deletion kokoro/windows/presubmit.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cd %SRC%\build
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!

IF /I "%BUILD_SYSTEM%"=="cmake" (
cmake .. -G "%BUILD_GENERATOR%" "-DMARL_BUILD_TESTS=1" "-DMARL_BUILD_EXAMPLES=1" "-DMARL_BUILD_BENCHMARKS=1" "-DMARL_WARNINGS_AS_ERRORS=1"
cmake .. -G "%BUILD_GENERATOR%" "-DMARL_BUILD_TESTS=1" "-DMARL_BUILD_EXAMPLES=1" "-DMARL_BUILD_BENCHMARKS=1" "-DMARL_WARNINGS_AS_ERRORS=1" "-DMARL_DEBUG_ENABLED=1"
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
%MSBUILD% /p:Configuration=%CONFIG% Marl.sln
if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
Expand Down

0 comments on commit 56fc2b0

Please sign in to comment.