Skip to content

Commit

Permalink
Merge pull request zeromq#1241 from sappo/master
Browse files Browse the repository at this point in the history
Enforce assert in release mode AND travis ci build fix for windows
  • Loading branch information
bluca authored Mar 13, 2020
2 parents 2d00eb9 + a45d967 commit c4b704b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ foreach(TEST_CLASS ${TEST_CLASSES})
NAME ${TEST_CLASS}
COMMAND zproject_selftest --continue --verbose --test ${TEST_CLASS}
)
IF (WIN32 AND CMAKE_PREFIX_PATH)
file(TO_NATIVE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH_WIN)
set_tests_properties(
${TEST_CLASS}
PROPERTIES ENVIRONMENT "PATH=%PATH%\;${CMAKE_PREFIX_PATH_WIN}\\bin"
)
ENDIF (WIN32 AND CMAKE_PREFIX_PATH)
set_tests_properties(
${TEST_CLASS}
PROPERTIES TIMEOUT ${CLASSTEST_TIMEOUT}
Expand Down
10 changes: 10 additions & 0 deletions zproject_class.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,16 @@ $(project.GENERATED_WARNING_HEADER:)
// Platform definitions, must come first
#include "platform.h"

// Asserts check the invariants of methods. If they're not
// fulfilled the program should fail fast. Therefore enforce them!
#ifdef NDEBUG
#undef NDEBUG
#include <assert.h>
#define NDEBUG
#else
#include <assert.h>
#endif

// External API
#include "../include/$(project.header:)"

Expand Down
14 changes: 10 additions & 4 deletions zproject_travis.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,10 @@ windows)
choco install openjdk
export JAVA_HOME="C:\\Program Files\\OpenJDK\\jdk-13.0.2"
export BUILD_PREFIX=$TEMP/ci_build
# Build will fail if processes are still running at the end of the script.
# Gradle by default starts a daemon so consequtive builds are faster.
# Therefore instruct gradle not to use its daemon.
export GRADLE_OPTS=-Dorg.gradle.daemon=false

cd ..

Expand All @@ -834,6 +838,12 @@ windows)
cmake --build . --config Release --target install
cd ../..

if [ -d "$(use.project)/bindings/jni" ]; then
cd $(use.project)/bindings/jni
./gradlew publishToMavenLocal -PbuildPrefix=$BUILD_PREFIX --info
cd ../../..
fi

.endfor
cd $(project.name)
mkdir build
Expand All @@ -845,10 +855,6 @@ windows)

cd $(project.name)
cd bindings/jni
# Build will fail if processes are still running at the end of the script.
# Gradle by default starts a daemon so consequtive builds are faster.
# Therefore instruct gradle not to use its daemon.
export GRADLE_OPTS=-Dorg.gradle.daemon=false
./gradlew build jar -PbuildPrefix=$BUILD_PREFIX -x test --info
./gradlew publishToMavenLocal -PbuildPrefix=$BUILD_PREFIX --info

Expand Down

0 comments on commit c4b704b

Please sign in to comment.