Skip to content

Commit

Permalink
Merge c61ce99 into 8f4400b
Browse files Browse the repository at this point in the history
  • Loading branch information
zugz committed May 6, 2020
2 parents 8f4400b + c61ce99 commit a1b20fe
Show file tree
Hide file tree
Showing 18 changed files with 676 additions and 608 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Expand Up @@ -393,11 +393,18 @@ endif()

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

if(AUTOTEST)
add_library(run_auto_test
auto_tests/run_auto_test.c
auto_tests/run_auto_test.h)
target_link_modules(run_auto_test toxcore misc_tools)
endif()

function(auto_test target)
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)
target_link_modules(auto_${target}_test toxcore misc_tools run_auto_test)
if(NOT ARGV1 STREQUAL "DONT_RUN")
add_test(NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target}_test)
set_tests_properties(${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS}")
Expand Down
7 changes: 6 additions & 1 deletion auto_tests/BUILD.bazel
Expand Up @@ -8,8 +8,13 @@ cc_library(

cc_library(
name = "run_auto_test",
testonly = True,
srcs = ["run_auto_test.c"],
hdrs = ["run_auto_test.h"],
deps = [
":check_compat",
"//c-toxcore/testing:misc_tools",
"//c-toxcore/toxcore",
],
)

flaky_tests = {
Expand Down
5 changes: 4 additions & 1 deletion auto_tests/Makefile.inc
@@ -1,5 +1,8 @@
if BUILD_TESTS

noinst_LTLIBRARIES += librun_auto_test.la
librun_auto_test_la_SOURCES = ../auto_tests/run_auto_test.c ../auto_tests/run_auto_test.h

TESTS = \
bootstrap_test \
conference_double_invite_test \
Expand Down Expand Up @@ -50,13 +53,13 @@ AUTOTEST_LDADD = \
$(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \
libmisc_tools.la \
librun_auto_test.la \
libtoxcore.la \
libtoxencryptsave.la \
$(LIBSODIUM_LIBS) \
$(NACL_OBJECTS) \
$(NACL_LIBS)


if BUILD_AV
TESTS += conference_av_test toxav_basic_test toxav_many_test
AUTOTEST_LDADD += libtoxav.la
Expand Down

0 comments on commit a1b20fe

Please sign in to comment.