@@ -393,10 +393,10 @@ endif()
393393
394394option (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,17 +406,12 @@ function(auto_test target)
406406 endif ()
407407endfunction ()
408408
409+ function (auto_test target )
410+ auto_test_common(${target} "c" ${ARGN} )
411+ endfunction ()
412+
409413function (auto_test_cc target )
410- if (AUTOTEST AND NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD" ))
411- add_executable (auto_${target} _test ${CPUFEATURES}
412- auto_tests/${target} _test.cc)
413- target_link_modules(auto_${target} _test toxcore misc_tools)
414- if (NOT ARGV1 STREQUAL "DONT_RUN" )
415- add_test (NAME ${target} COMMAND ${CROSSCOMPILING_EMULATOR} auto_${target} _test)
416- set_tests_properties (${target} PROPERTIES TIMEOUT "${TEST_TIMEOUT_SECONDS} " )
417- set_property (TEST ${target} PROPERTY ENVIRONMENT "LLVM_PROFILE_FILE=${target} .profraw" )
418- endif ()
419- endif ()
414+ auto_test_common(${target} "cc" ${ARGN} )
420415endfunction ()
421416
422417auto_test(TCP)
0 commit comments