minetest/util/travis/script.sh
Loic Blot b3aeba684b Unit tests must be done at integration process.
* Remove --enable-unittests and --disable-unittests and add --do-unittests function
* --do-unittests function will exit 0 on success.
* minetest and minetestserver binaries are launched with --do-unittests in travis build.
2015-02-21 11:04:19 +01:00

29 lines
1.2 KiB
Bash
Executable File

#!/bin/bash -e
if [ $WINDOWS = "no" ]; then
mkdir -p travisbuild
cd travisbuild
cmake -DENABLE_GETTEXT=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DCMAKE_BUILD_TYPE=Debug ..
make -j2
echo "Running unit tests for minetest"
../bin/minetest --do-unittests
echo "Running unit tests for minetestserver"
../bin/minetestserver --do-unittests
else
[ $CC = "clang" ] && exit 1 # Not supposed to happen
# We need to have our build directory outside of the minetest directory because
# CMake will otherwise get very very confused with symlinks and complain that
# something is not a subdirectory of something even if it actually is.
# e.g.:
# /home/travis/minetest/minetest/travisbuild/minetest
# \/ \/ \/
# /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest
# \/ \/ \/
# /home/travis/minetest/minetest/travisbuild/minetest/travisbuild/minetest/travisbuild/minetest
# You get the idea.
OLDDIR=`pwd`
cd ..
[ $WINDOWS = "32" ] && EXISTING_MINETEST_DIR=$OLDDIR NO_MINETEST_GAME=1 $OLDDIR/util/buildbot/buildwin32.sh travisbuild && exit 0
[ $WINDOWS = "64" ] && EXISTING_MINETEST_DIR=$OLDDIR NO_MINETEST_GAME=1 $OLDDIR/util/buildbot/buildwin64.sh travisbuild && exit 0
fi