2016-01-27 19:12:05 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e # (errexit) Exit if any subcommand or pipeline returns a non-zero status
|
|
|
|
set -u # (nounset) Exit on any attempt to use an uninitialised variable
|
|
|
|
|
|
|
|
: ${CXX:=}
|
|
|
|
: ${TRAVIS:=false}
|
|
|
|
|
|
|
|
echo -n "Checking that we're running on Travis CI..."
|
|
|
|
if [[ $TRAVIS == 'true' ]]; then
|
|
|
|
echo " OK"
|
|
|
|
else
|
|
|
|
echo " Nope."
|
|
|
|
echo "This script is only intended for use on Travis CI."
|
|
|
|
echo "Set the TRAVIS environment variable to 'true' to override."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p build
|
2016-01-27 19:16:14 +01:00
|
|
|
pushd build > /dev/null
|
2016-01-27 19:12:05 +01:00
|
|
|
|
2016-02-02 16:54:45 +01:00
|
|
|
# Boost does not correctly identify version of libstdc++ used by clang
|
|
|
|
CMAKE_FLAGS=
|
|
|
|
if [[ $CXX == 'clang++' ]]; then
|
|
|
|
CMAKE_FLAGS=-DCMAKE_CXX_FLAGS=-DBOOST_NO_CXX11_ALLOCATOR
|
2016-02-02 17:26:18 +01:00
|
|
|
echo "Additional flags to pass to cmake: $CMAKE_FLAGS"
|
2016-02-02 16:54:45 +01:00
|
|
|
fi
|
|
|
|
|
2016-08-06 21:38:27 +02:00
|
|
|
echo "Attempting to build and run test suite with C++11 support enabled..."
|
|
|
|
cmake $CMAKE_FLAGS -DVALIJSON_CXX11_ADAPTERS=enabled ..
|
2016-02-02 17:48:03 +01:00
|
|
|
VERBOSE=1 make
|
2016-01-27 19:12:05 +01:00
|
|
|
./test_suite
|
|
|
|
make clean
|
|
|
|
|
2016-01-27 19:16:14 +01:00
|
|
|
popd > /dev/null
|
2016-02-02 16:54:45 +01:00
|
|
|
|