Skip to content

Commit 4a1e2d8

Browse files
sudden6iphydf
authored andcommitted
test: add test for multithreaded ToxAV
This tests tox_iterate in a separate thread, and the two ToxAV modes.
1 parent f46f51e commit 4a1e2d8

File tree

8 files changed

+568
-14
lines changed

8 files changed

+568
-14
lines changed

.github/scripts/cmake-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ci_script() {
2626
add_flag -gdwarf-2
2727

2828
# Fix invalid register for .seh_savexmm error
29-
add_flag -fno-asynchronous-unwind-tables
29+
add_c_flag -fno-asynchronous-unwind-tables
3030

3131
docker run \
3232
-e ALLOW_TEST_FAILURE=true \

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,10 @@ endif()
393393

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

396-
function(auto_test target)
396+
function(auto_test_common target extension)
397397
if(AUTOTEST AND NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD"))
398398
add_executable(auto_${target}_test ${CPUFEATURES}
399-
auto_tests/${target}_test.c)
399+
auto_tests/${target}_test.${extension})
400400
target_link_modules(auto_${target}_test toxcore misc_tools)
401401
if(NOT ARGV1 STREQUAL "DONT_RUN")
402402
add_test(NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target}_test)
@@ -406,6 +406,14 @@ function(auto_test target)
406406
endif()
407407
endfunction()
408408

409+
function(auto_test target)
410+
auto_test_common(${target} "c" ${ARGN})
411+
endfunction()
412+
413+
function(auto_test_cc target)
414+
auto_test_common(${target} "cc" ${ARGN})
415+
endfunction()
416+
409417
auto_test(TCP)
410418
auto_test(conference)
411419
auto_test(conference_double_invite)
@@ -454,6 +462,7 @@ if(BUILD_TOXAV)
454462
auto_test(conference_av MSVC_DONT_BUILD)
455463
auto_test(toxav_basic)
456464
auto_test(toxav_many)
465+
auto_test_cc(toxav_mt)
457466
endif()
458467

459468
################################################################################

auto_tests/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ flaky_tests = {
2020
}
2121

2222
[cc_test(
23-
name = src[:-2],
23+
name = src[:src.rindex(".")-len(src)],
2424
size = "small",
2525
srcs = [src],
2626
args = ["$(location %s)" % src],
@@ -38,4 +38,4 @@ flaky_tests = {
3838
"//c-toxcore/toxcore:DHT_srcs",
3939
"//c-toxcore/toxencryptsave",
4040
],
41-
) for src in glob(["*_test.c"])]
41+
) for src in glob(["*_test.c*"])]

0 commit comments

Comments
 (0)