Make docker_run.sh use 4 space indenting to match other shell scripts.

Also split apart the really long scons/cmake single lines
This commit is contained in:
pentarctagon 2018-03-06 19:12:38 -06:00 committed by Jyrki Vesterinen
parent 5e272829fa
commit 258b8b9bae

View file

@ -19,9 +19,9 @@ BOOST_TEST="${11}"
# only enable strict builds when no optimizations are done
if [ "$EXTRA_FLAGS_RELEASE" == "-O0" ]; then
STRICT="true"
STRICT="true"
else
STRICT="false"
STRICT="false"
fi
echo "Using configuration:"
@ -39,81 +39,92 @@ echo "BOOST_TEST: $BOOST_TEST"
$CXX --version
# if doing the translations, don't build anything else
if [ "$NLS" == "true" ]; then
if [ "$TOOL" == "cmake" ]; then
cmake -DENABLE_NLS=true -DENABLE_GAME=false -DENABLE_SERVER=false -DENABLE_CAMPAIGN_SERVER=false -DENABLE_TESTS=false && make VERBOSE=1 -j2
else
scons translations build=release --debug=time nls=true jobs=2
fi
if [ "$TOOL" == "cmake" ]; then
cmake -DENABLE_NLS=true -DENABLE_GAME=false -DENABLE_SERVER=false -DENABLE_CAMPAIGN_SERVER=false -DENABLE_TESTS=false && make VERBOSE=1 -j2
else
scons translations build=release --debug=time nls=true jobs=2
fi
else
# if not doing the translations, build wesnoth, wesnothd, campaignd, boost_unit_tests
if [ "$TOOL" == "cmake" ]; then
# set ccache configurations
echo "max_size = 200M" > $HOME/.ccache/ccache.conf
echo "compiler_check = content" >> $HOME/.ccache/ccache.conf
if [ "$TOOL" == "cmake" ]; then
echo "max_size = 200M" > $HOME/.ccache/ccache.conf
echo "compiler_check = content" >> $HOME/.ccache/ccache.conf
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false \
-DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO=false \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache && \
make VERBOSE=1 -j2
BUILD_RET=$?
ccache -s
ccache -z
else
scons wesnoth wesnothd campaignd boost_unit_tests build=release \
ctool=$CC cxxtool=$CXX cxx_std=$CXXSTD \
extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" \
nls=false enable_lto=false jobs=2 --debug=time
BUILD_RET=$?
fi
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false -DEXTRA_FLAGS_CONFIG="-pipe" -DEXTRA_FLAGS_RELEASE="$EXTRA_FLAGS_RELEASE" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO=false -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache && make VERBOSE=1 -j2
BUILD_RET=$?
if [ $BUILD_RET != 0 ]; then
exit $BUILD_RET
fi
ccache -s
ccache -z
else
scons wesnoth wesnothd campaignd boost_unit_tests build=release ctool=$CC cxxtool=$CXX --debug=time extra_flags_config="-pipe" extra_flags_release="$EXTRA_FLAGS_RELEASE" strict="$STRICT" cxx_std=$CXXSTD nls=false jobs=2 enable_lto=false
BUILD_RET=$?
fi
if [ $BUILD_RET != 0 ]; then
exit $BUILD_RET
fi
# needed since docker returns the exit code of the final comman executed, so a failure needs to be returned if any unit tests fail
EXIT_VAL=0
if [ "$WML_TESTS" == "true" ]; then
echo "Executing run_wml_tests"
./run_wml_tests -g -v -c -t "$WML_TEST_TIME"
RET=$?
if [ $RET != 0 ]; then
echo "WML tests failed!"
EXIT_VAL=$RET
EXIT_VAL=0
if [ "$WML_TESTS" == "true" ]; then
echo "Executing run_wml_tests"
./run_wml_tests -g -v -c -t "$WML_TEST_TIME"
RET=$?
if [ $RET != 0 ]; then
echo "WML tests failed!"
EXIT_VAL=$RET
fi
fi
fi
if [ "$PLAY_TEST" == "true" ]; then
echo "Executing play_test_executor.sh"
./utils/travis/play_test_executor.sh
RET=$?
if [ $RET != 0 ]; then
echo "Play tests failed!"
EXIT_VAL=$RET
if [ "$PLAY_TEST" == "true" ]; then
echo "Executing play_test_executor.sh"
./utils/travis/play_test_executor.sh
RET=$?
if [ $RET != 0 ]; then
echo "Play tests failed!"
EXIT_VAL=$RET
fi
fi
fi
if [ "$MP_TEST" == "true" ]; then
echo "Executing mp_test_executor.sh"
./utils/travis/mp_test_executor.sh
RET=$?
if [ $RET != 0 ]; then
echo "MP tests failed!"
EXIT_VAL=$RET
if [ "$MP_TEST" == "true" ]; then
echo "Executing mp_test_executor.sh"
./utils/travis/mp_test_executor.sh
RET=$?
if [ $RET != 0 ]; then
echo "MP tests failed!"
EXIT_VAL=$RET
fi
fi
fi
if [ "$BOOST_TEST" == "true" ]; then
echo "Executing boost unit tests"
./utils/travis/test_executor.sh
RET=$?
if [ $RET != 0 ]; then
echo "Boost tests failed!"
EXIT_VAL=$RET
if [ "$BOOST_TEST" == "true" ]; then
echo "Executing boost unit tests"
./utils/travis/test_executor.sh
RET=$?
if [ $RET != 0 ]; then
echo "Boost tests failed!"
EXIT_VAL=$RET
fi
fi
fi
if [ -f "errors.log" ]; then
echo -e "\n*** \n*\n* Errors reported in wml unit tests, here is errors.log...\n*\n*** \n"
cat errors.log
fi
exit $EXIT_VAL
if [ -f "errors.log" ]; then
echo -e "\n*** \n*\n* Errors reported in wml unit tests, here is errors.log...\n*\n*** \n"
cat errors.log
fi
exit $EXIT_VAL
fi