Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AUTOTEST option to CMakeLists.txt #1223

Merged
merged 1 commit into from
Oct 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/cmake-asan
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ cmake -B_build -H. -GNinja \
-DMUST_BUILD_TOXAV=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF
-DUSE_IPV6=OFF \
-DAUTOTEST=ON

cd _build

Expand Down
3 changes: 2 additions & 1 deletion .circleci/cmake-tsan
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ cmake -H. -B_build -GNinja \
-DMUST_BUILD_TOXAV=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF
-DUSE_IPV6=OFF \
-DAUTOTEST=ON

cd _build

Expand Down
3 changes: 2 additions & 1 deletion .travis/cmake-freebsd-stage2
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ travis_script() {
-DMUST_BUILD_TOXAV=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF'
-DUSE_IPV6=OFF \
-DAUTOTEST=ON'

# We created the VM with the same number of cores as the host, so the host-ran `nproc` here is fine
RUN 'gmake "-j$NPROC" -k install -C_build'
Expand Down
3 changes: 2 additions & 1 deletion .travis/cmake-linux
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ travis_script() {
-DMUST_BUILD_TOXAV=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF
-DUSE_IPV6=OFF \
-DAUTOTEST=ON

cd _build # pushd
make "-j$NPROC" -k install
Expand Down
3 changes: 2 additions & 1 deletion .travis/cmake-osx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ travis_script() {
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF
-DUSE_IPV6=OFF \
-DAUTOTEST=ON

cd _build # pushd
make "-j$NPROC" -k install
Expand Down
2 changes: 1 addition & 1 deletion .travis/cmake-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ travis_script() {
-e ENABLE_ARCH_i686=$i686 \
-e ENABLE_ARCH_x86_64=$x86_64 \
-e ENABLE_TEST=true \
-e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90" \
-e EXTRA_CMAKE_FLAGS="-DBOOTSTRAP_DAEMON=OFF -DMIN_LOGGER_LEVEL=DEBUG -DTEST_TIMEOUT_SECONDS=90 -DAUTOTEST=ON" \
-e DCMAKE_C_FLAGS="$C_FLAGS" \
-e CMAKE_CXX_FLAGS="$CXX_FLAGS" \
-e CMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,10 @@ if(ANDROID_CPU_FEATURES)
set(CPUFEATURES other/cpufeatures.c)
endif()

option(AUTOTEST "Enable autotests (mainly for CI)" OFF)

function(auto_test target)
if(NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD"))
if(AUTOTEST AND NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD"))
add_executable(auto_${target}_test ${CPUFEATURES}
auto_tests/${target}_test.c)
target_link_modules(auto_${target}_test toxcore misc_tools)
Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ There are some options that are available to configure the build.
| `STRICT_ABI` | Enforce strict ABI export in dynamic libraries. | ON or OFF | OFF |
| `TEST_TIMEOUT_SECONDS` | Limit runtime of each test to the number of seconds specified. | Positive number or nothing (empty string). | Empty string. |
| `USE_IPV6` | Use IPv6 in tests. | ON or OFF | ON |
| `AUTOTEST` | Enable autotests (mainly for CI). | ON or OFF | OFF |

You can get this list of option using the following commands

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install:
- cd ../..

before_build:
- cmake -B_build -H. -DBOOTSTRAP_DAEMON=OFF -DENABLE_SHARED=OFF -DBUILD_TOXAV=OFF -DTEST_TIMEOUT_SECONDS=120
- cmake -B_build -H. -DBOOTSTRAP_DAEMON=OFF -DENABLE_SHARED=OFF -DBUILD_TOXAV=OFF -DTEST_TIMEOUT_SECONDS=120 -DAUTOTEST=ON

build:
project: _build/INSTALL.vcxproj
Expand Down