Run unit tests in a separate build

pull/3011/head
elsid 4 years ago
parent 7cd5940f00
commit 23fe60a067
No known key found for this signature in database
GPG Key ID: D27B8E8D10A2896B

@ -45,6 +45,12 @@ matrix:
os: linux os: linux
dist: focal dist: focal
if: branch != coverity_scan if: branch != coverity_scan
- name: OpenMW (tests only) on Ubuntu Focal with GCC
os: linux
dist: focal
if: branch != coverity_scan
env:
- BUILD_TESTS_ONLY: 1
- name: OpenMW (openmw) on Ubuntu Focal with Clang's Static Analysis - name: OpenMW (openmw) on Ubuntu Focal with Clang's Static Analysis
os: linux os: linux
dist: focal dist: focal
@ -73,7 +79,7 @@ script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ${ANALYZE} make -j3; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ${ANALYZE} make -j3; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then ../CI/check_package.osx.sh; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then ../CI/check_package.osx.sh; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${BUILD_TESTS_ONLY}" ]; then ./openmw_test_suite; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi - if [ "${COVERITY_SCAN_BRANCH}" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi
- cd "${TRAVIS_BUILD_DIR}" - cd "${TRAVIS_BUILD_DIR}"
- ccache -s - ccache -s

@ -2,22 +2,43 @@
free -m free -m
env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_googletest.sh if [[ "${BUILD_TESTS_ONLY}" ]]; then
GOOGLETEST_DIR="$(pwd)/googletest/build" export GOOGLETEST_DIR="$(pwd)/googletest/build/install"
env GENERATOR='Unix Makefiles' CONFIGURATION=Release CI/build_googletest.sh
fi
mkdir build mkdir build
cd build cd build
${ANALYZE} cmake \ if [[ "${BUILD_TESTS_ONLY}" ]]; then
-DCMAKE_C_COMPILER="${CC}" \ ${ANALYZE} cmake \
-DCMAKE_CXX_COMPILER="${CXX}" \ -D CMAKE_C_COMPILER="${CC}" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -D CMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -D CMAKE_C_COMPILER_LAUNCHER=ccache \
-DBUILD_UNITTESTS=TRUE \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_SYSTEM_TINYXML=TRUE \ -D CMAKE_INSTALL_PREFIX=install \
-DCMAKE_INSTALL_PREFIX="/usr" \ -D CMAKE_BUILD_TYPE=RelWithDebInfo \
-DBINDIR="/usr/games" \ -D USE_SYSTEM_TINYXML=TRUE \
-DCMAKE_BUILD_TYPE="DEBUG" \ -D BUILD_OPENMW=OFF \
-DGTEST_ROOT="${GOOGLETEST_DIR}" \ -D BUILD_BSATOOL=OFF \
-DGMOCK_ROOT="${GOOGLETEST_DIR}" \ -D BUILD_ESMTOOL=OFF \
.. -D BUILD_LAUNCHER=OFF \
-D BUILD_MWINIIMPORTER=OFF \
-D BUILD_ESSIMPORTER=OFF \
-D BUILD_OPENCS=OFF \
-D BUILD_WIZARD=OFF \
-D BUILD_UNITTESTS=ON \
-D GTEST_ROOT="${GOOGLETEST_DIR}" \
-D GMOCK_ROOT="${GOOGLETEST_DIR}" \
..
else
${ANALYZE} cmake \
-D CMAKE_C_COMPILER="${CC}" \
-D CMAKE_CXX_COMPILER="${CXX}" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D USE_SYSTEM_TINYXML=TRUE \
-D CMAKE_INSTALL_PREFIX=install \
-D CMAKE_BUILD_TYPE=Debug \
..
fi

@ -1,13 +1,17 @@
#!/bin/sh -e #!/bin/sh -ex
git clone -b release-1.10.0 https://github.com/google/googletest.git git clone -b release-1.10.0 https://github.com/google/googletest.git
cd googletest cd googletest
mkdir build mkdir build
cd build cd build
cmake \ cmake \
-D CMAKE_C_COMPILER="${CC}" \
-D CMAKE_CXX_COMPILER="${CXX}" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_BUILD_TYPE="${CONFIGURATION}" \ -D CMAKE_BUILD_TYPE="${CONFIGURATION}" \
-D CMAKE_INSTALL_PREFIX=. \ -D CMAKE_INSTALL_PREFIX="${GOOGLETEST_DIR}" \
-G "${GENERATOR}" \ -G "${GENERATOR}" \
.. ..
cmake --build . --config "${CONFIGURATION}" cmake --build . --config "${CONFIGURATION}" -- -j $(nproc)
cmake --build . --target install --config "${CONFIGURATION}" cmake --install . --config "${CONFIGURATION}"

Loading…
Cancel
Save