chore(CMake/Tests): use conventional CMake flag to enable tests (#3809)

This commit is contained in:
Francesco Borzì
2020-11-29 19:28:47 +01:00
committed by GitHub
parent 885f45c63c
commit c838b371dd
7 changed files with 7 additions and 7 deletions

View File

@@ -142,7 +142,7 @@ add_subdirectory(src)
CU_RUN_HOOK("AFTER_SRC_LOAD") CU_RUN_HOOK("AFTER_SRC_LOAD")
if( UNIT_TESTS ) if( BUILD_TESTING )
# we use these flags to get code coverage # we use these flags to get code coverage
set(UNIT_TEST_CXX_FLAGS "-fprofile-arcs -ftest-coverage -fno-inline") set(UNIT_TEST_CXX_FLAGS "-fprofile-arcs -ftest-coverage -fno-inline")

View File

@@ -8,7 +8,7 @@ CWARNINGS=ON
CDEBUG=OFF CDEBUG=OFF
CTYPE=Release CTYPE=Release
CSCRIPTS=ON CSCRIPTS=ON
CUNIT_TESTS=ON CBUILD_TESTING=ON
CSERVERS=ON CSERVERS=ON
CTOOLS=ON CTOOLS=ON
CSCRIPTPCH=OFF CSCRIPTPCH=OFF

View File

@@ -9,7 +9,7 @@ mkdir var/build/obj && cd var/build/obj;
time cmake ../../../ \ time cmake ../../../ \
-DTOOLS=1 \ -DTOOLS=1 \
-DUNIT_TESTS=1 \ -DBUILD_TESTING=1 \
-DSCRIPTS=1 \ -DSCRIPTS=1 \
-DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_BUILD_TYPE=Debug \
-DMYSQL_ADD_INCLUDE_PATH=/usr/local/include \ -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include \

View File

@@ -35,7 +35,7 @@ function comp_configure() {
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF -DSERVERS=$CSERVERS \ cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF -DSERVERS=$CSERVERS \
-DSCRIPTS=$CSCRIPTS \ -DSCRIPTS=$CSCRIPTS \
-DUNIT_TESTS=$CUNIT_TESTS \ -DBUILD_TESTING=$CBUILD_TESTING \
-DTOOLS=$CTOOLS -DUSE_SCRIPTPCH=$CSCRIPTPCH -DUSE_COREPCH=$CCOREPCH -DWITH_COREDEBUG=$CDEBUG -DCMAKE_BUILD_TYPE=$CTYPE -DWITH_WARNINGS=$CWARNINGS \ -DTOOLS=$CTOOLS -DUSE_SCRIPTPCH=$CSCRIPTPCH -DUSE_COREPCH=$CCOREPCH -DWITH_COREDEBUG=$CDEBUG -DCMAKE_BUILD_TYPE=$CTYPE -DWITH_WARNINGS=$CWARNINGS \
-DCMAKE_C_COMPILER=$CCOMPILERC -DCMAKE_CXX_COMPILER=$CCOMPILERCXX "-DDISABLED_AC_MODULES=$CDISABLED_AC_MODULES" $CCUSTOMOPTIONS -DCMAKE_C_COMPILER=$CCOMPILERC -DCMAKE_CXX_COMPILER=$CCOMPILERCXX "-DDISABLED_AC_MODULES=$CDISABLED_AC_MODULES" $CCUSTOMOPTIONS

View File

@@ -1,6 +1,6 @@
option(SERVERS "Build worldserver and authserver" 1) option(SERVERS "Build worldserver and authserver" 1)
option(SCRIPTS "Build core with scripts included" 1) option(SCRIPTS "Build core with scripts included" 1)
option(UNIT_TESTS "Build unit tests" 0) option(BUILD_TESTING "Build unit tests" 0)
option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0) option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0)
option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1)
option(USE_COREPCH "Use precompiled headers when compiling servers" 1) option(USE_COREPCH "Use precompiled headers when compiling servers" 1)

2
conf/dist/config.sh vendored
View File

@@ -48,7 +48,7 @@ CTYPE=Release
# compile scripts # compile scripts
CSCRIPTS=ON CSCRIPTS=ON
# compile unit tests # compile unit tests
CUNIT_TESTS=OFF CBUILD_TESTING=OFF
# compile server # compile server
CSERVERS=ON CSERVERS=ON
# compile tools # compile tools

View File

@@ -40,7 +40,7 @@ else()
message("* Build map/vmap tools : No (default)") message("* Build map/vmap tools : No (default)")
endif() endif()
if( UNIT_TESTS ) if( BUILD_TESTING )
message("* Build unit tests : Yes") message("* Build unit tests : Yes")
else() else()
message("* Build unit tests : No (default)") message("* Build unit tests : No (default)")