2016-10-06 10:04:55 -04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This script is used by Travis CI to configure, build and test wxWidgets
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-01-25 13:21:42 -05:00
|
|
|
wxPROC_COUNT=`getconf _NPROCESSORS_ONLN`
|
|
|
|
((wxPROC_COUNT++))
|
|
|
|
if [ "$wxTOOLSET" == "cmake" ] && [ "$wxCMAKE_GENERATOR" == "Xcode" ]; then
|
|
|
|
wxJOBS="-jobs $wxPROC_COUNT"
|
|
|
|
else
|
|
|
|
wxJOBS="-j$wxPROC_COUNT"
|
|
|
|
fi
|
|
|
|
|
2016-10-07 08:02:02 -04:00
|
|
|
case $wxTOOLSET in
|
|
|
|
cmake)
|
|
|
|
if [ -z $wxCMAKE_TESTS ]; then wxCMAKE_TESTS=CONSOLE_ONLY; fi
|
|
|
|
cmake --version
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2016-10-07 08:02:02 -04:00
|
|
|
echo 'travis_fold:start:configure'
|
|
|
|
echo 'Configuring...'
|
|
|
|
mkdir build_cmake
|
|
|
|
pushd build_cmake
|
2017-12-09 08:38:11 -05:00
|
|
|
cmake -G "$wxCMAKE_GENERATOR" $wxCMAKE_DEFINES -D wxBUILD_SAMPLES=SOME -D wxBUILD_TESTS=$wxCMAKE_TESTS ..
|
2016-10-07 08:02:02 -04:00
|
|
|
echo 'travis_fold:end:configure'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2016-10-07 08:02:02 -04:00
|
|
|
echo 'travis_fold:start:building'
|
|
|
|
echo 'Building...'
|
2018-01-25 13:21:42 -05:00
|
|
|
cmake --build . -- $wxJOBS
|
2016-10-07 08:02:02 -04:00
|
|
|
echo 'travis_fold:end:building'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2016-10-07 08:02:02 -04:00
|
|
|
if [ "$wxCMAKE_TESTS" != "OFF" ]; then
|
|
|
|
echo 'travis_fold:start:testing'
|
|
|
|
echo 'Testing...'
|
2018-07-30 18:12:17 -04:00
|
|
|
ctest -V -C Debug -R "test_base" --output-on-failure --interactive-debug-mode 0 .
|
2016-10-07 08:02:02 -04:00
|
|
|
echo 'travis_fold:end:testing'
|
|
|
|
fi
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2019-01-23 18:07:45 -05:00
|
|
|
echo 'Installing...' && echo -en 'travis_fold:start:script.install\\r'
|
|
|
|
sudo env "PATH=$PATH" cmake --build . --target install
|
2019-02-03 13:00:14 -05:00
|
|
|
popd
|
2019-01-23 18:07:45 -05:00
|
|
|
echo -en 'travis_fold:end:script.install\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
|
|
|
echo 'Testing installation...' && echo -en 'travis_fold:start:script.testinstall\\r'
|
|
|
|
mkdir build_cmake_install_test
|
|
|
|
pushd build_cmake_install_test
|
|
|
|
cmake "$wxCMAKE_GENERATOR" $wxCMAKE_DEFINES ../samples/minimal
|
|
|
|
cmake --build .
|
2019-01-23 18:07:45 -05:00
|
|
|
popd
|
2019-02-03 13:00:14 -05:00
|
|
|
echo -en 'travis_fold:end:script.testinstall\\r'
|
2016-10-07 08:02:02 -04:00
|
|
|
;;
|
|
|
|
*)
|
2017-12-09 08:38:11 -05:00
|
|
|
echo 'Configuring...' && echo -en 'travis_fold:start:script.configure\\r'
|
2016-10-07 08:02:02 -04:00
|
|
|
./configure --disable-optimise $wxCONFIGURE_FLAGS
|
2017-12-09 08:38:11 -05:00
|
|
|
echo -en 'travis_fold:end:script.configure\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2017-12-09 08:38:11 -05:00
|
|
|
echo 'Building...' && echo -en 'travis_fold:start:script.build\\r'
|
2018-01-25 13:21:42 -05:00
|
|
|
make $wxJOBS
|
2017-12-09 08:38:11 -05:00
|
|
|
echo -en 'travis_fold:end:script.build\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2017-12-09 08:38:11 -05:00
|
|
|
echo 'Building tests...' && echo -en 'travis_fold:start:script.tests\\r'
|
2018-01-25 13:21:42 -05:00
|
|
|
make -C tests $wxJOBS
|
2017-12-09 08:38:11 -05:00
|
|
|
echo -en 'travis_fold:end:script.tests\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2017-12-09 08:38:11 -05:00
|
|
|
echo 'Testing...' && echo -en 'travis_fold:start:script.testing\\r'
|
|
|
|
pushd tests && ./test && popd
|
|
|
|
echo -en 'travis_fold:end:script.testing\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2019-07-17 06:32:20 -04:00
|
|
|
if [ "$wxUSE_XVFB" = 1 ]; then
|
|
|
|
echo 'Testing GUI using Xvfb...' && echo -en 'travis_fold:start:script.testing_gui\\r'
|
2019-07-17 16:44:29 -04:00
|
|
|
pushd tests && xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui && popd
|
2018-12-08 13:16:08 -05:00
|
|
|
echo -en 'travis_fold:end:script.testing_gui\\r'
|
|
|
|
fi
|
|
|
|
|
2017-12-09 08:38:11 -05:00
|
|
|
echo 'Building samples...' && echo -en 'travis_fold:start:script.samples\\r'
|
|
|
|
(test "$wxSKIP_SAMPLES" && echo 'SKIPPED') || make samples
|
|
|
|
echo -en 'travis_fold:end:script.samples\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
2017-12-09 08:38:11 -05:00
|
|
|
echo 'Installing...' && echo -en 'travis_fold:start:script.install\\r'
|
2016-10-07 08:02:02 -04:00
|
|
|
sudo make install
|
2017-12-09 08:38:11 -05:00
|
|
|
echo -en 'travis_fold:end:script.install\\r'
|
2019-02-03 13:00:14 -05:00
|
|
|
|
|
|
|
echo 'Testing installation...' && echo -en 'travis_fold:start:script.testinstall\\r'
|
|
|
|
make -C samples/minimal -f makefile.unx clean
|
|
|
|
make -C samples/minimal -f makefile.unx $wxMAKEFILE_FLAGS
|
|
|
|
echo -en 'travis_fold:end:script.testinstall\\r'
|
2016-10-07 08:02:02 -04:00
|
|
|
;;
|
|
|
|
esac
|