Skip to content
Open
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 .github/scripts/cmake-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ci_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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can pass the suffix and avoid duplicating this? It's literally 1 byte difference between the two macros.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for you?

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 MSVC_DONT_BUILD)
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 @@ -22,7 +22,7 @@ flaky_tests = {
}

[cc_test(
name = src[:-2],
name = src[:src.rindex(".")-len(src)],
size = "small",
srcs = [src],
args = ["$(location %s)" % src],
Expand Down Expand Up @@ -54,4 +54,4 @@ flaky_tests = {
"@libsodium",
"@libvpx",
],
) for src in glob(["*_test.c"])]
) for src in glob(["*_test.c*"])]
Loading