Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .travis/cmake-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ travis_script() {
add_flag -gdwarf-2

# Fix invalid register for .seh_savexmm error
add_flag -fno-asynchronous-unwind-tables
add_c_flag -fno-asynchronous-unwind-tables

docker run \
-e ALLOW_TEST_FAILURE=true \
Expand Down
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ endif()

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

function(auto_test target)
function(auto_test_common target extension)
if(AUTOTEST AND NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD"))
add_executable(auto_${target}_test ${CPUFEATURES}
auto_tests/${target}_test.c)
auto_tests/${target}_test.${extension})
target_link_modules(auto_${target}_test toxcore misc_tools)
if(NOT ARGV1 STREQUAL "DONT_RUN")
add_test(NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target}_test)
Expand All @@ -406,6 +406,14 @@ function(auto_test target)
endif()
endfunction()

function(auto_test target)
auto_test_common(${target} "c" ${ARGN})
endfunction()

function(auto_test_cc target)
auto_test_common(${target} "cc" ${ARGN})
endfunction()

auto_test(TCP)
auto_test(conference)
auto_test(conference_double_invite)
Expand Down Expand Up @@ -454,6 +462,7 @@ if(BUILD_TOXAV)
auto_test(conference_av)
auto_test(toxav_basic)
auto_test(toxav_many)
auto_test_cc(toxav_mt)
endif()

################################################################################
Expand Down
4 changes: 2 additions & 2 deletions auto_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ flaky_tests = {
}

[cc_test(
name = src[:-2],
name = src[:src.rindex(".")-len(src)],
size = "small",
srcs = [src],
args = ["$(location %s)" % src],
Expand All @@ -38,4 +38,4 @@ flaky_tests = {
"//c-toxcore/toxcore:DHT_srcs",
"//c-toxcore/toxencryptsave",
],
) for src in glob(["*_test.c"])]
) for src in glob(["*_test.c*"])]
Loading