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 option to set test timeout #188

Merged
merged 3 commits into from
Oct 5, 2016
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,16 @@ target_link_modules(toxencryptsave toxcore)
#
################################################################################

set(TEST_TIMEOUT_SECONDS "" CACHE STRING "Limit runtime of each test to the number of seconds specified")

if(APIDSL AND ASTYLE)
add_test(
NAME format_test
COMMAND ${CMAKE_SOURCE_DIR}/other/astyle/format-source
"${CMAKE_SOURCE_DIR}"
"${APIDSL}"
"${ASTYLE}")
set_tests_properties(format_test PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
endif()

function(auto_test target)
Expand All @@ -271,6 +274,7 @@ function(auto_test target)
target_link_modules(auto_${target}_test toxav)
endif()
add_test(NAME ${target} COMMAND auto_${target}_test)
set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
endif()
endfunction()

Expand Down
9 changes: 8 additions & 1 deletion other/travis/toxcore-script
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ export CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
# Build toxcore and run tests.
# TODO(iphydf): Enable ASAN. It currently has some bad interactions with gcov,
# so it's disabled on Travis.
RUN $CMAKE -B$BUILD_DIR -H. -DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install -DDEBUG=ON -DASSOC_DHT=ON -DSTRICT_ABI=ON #-DASAN=ON
RUN $CMAKE \
-B$BUILD_DIR \
-H. \
-DCMAKE_INSTALL_PREFIX:PATH=$CURDIR/_install \
-DDEBUG=ON \
-DASSOC_DHT=ON \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=300 #-DASAN=ON

export CTEST_OUTPUT_ON_FAILURE=1

Expand Down