aboutsummaryrefslogtreecommitdiff
path: root/.circleci
diff options
context:
space:
mode:
authorCarbenium <carbenium@outlook.com>2020-07-22 20:27:54 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-23 22:48:35 +0100
commitf837f28171970b56781a57b5dc503e6067abecd2 (patch)
tree77612e6204d75908228bff2915e42771880855fd /.circleci
parente8583d04f6a7744bd3576c3241873a8ad33f4f7a (diff)
dep: Add catch2 unit test framework and wire it up
To enable the test suite, make sure to configure CMake with -DBUILD_TESTING=1 , since it is disabled by default. The catch2 dependency will be downloaded during configure time. Also add a new target "tests-common", which includes unit tests for the "common" project. To finally run the tests use the "test" target. CircleCI: Run unit tests (cherry picked from commit 6a28ee7b2a4269aa7e43265d1cd0067537e3e883)
Diffstat (limited to '.circleci')
-rw-r--r--.circleci/config.yml12
1 files changed, 10 insertions, 2 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 16eb6cbf519..17cb3c89f74 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -23,7 +23,7 @@ jobs:
command: |
mkdir bin
cd bin
- cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install
+ cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1
cd ..
- run:
name: SQL checks
@@ -48,7 +48,15 @@ jobs:
command: |
cd bin
make -j 4 -k && make install
- cd check_install/bin
+ - run:
+ name: Unit tests
+ command: |
+ cd bin
+ make test
+ - run:
+ name: Check executables
+ command: |
+ cd bin/check_install/bin
./bnetserver --version
./worldserver --version
nopch: