@@ -970,18 +970,15 @@ if(BUILD_TESTING)
970
970
add_executable (test -fake-ssh ${CMAKE_SOURCE_DIR} /t/helper/test-fake-ssh.c )
971
971
target_link_libraries (test -fake-ssh common-main )
972
972
973
- #reftable-tests
974
- parse_makefile_for_sources (test -reftable_SOURCES "REFTABLE_TEST_OBJS" )
975
- list (TRANSFORM test -reftable_SOURCES PREPEND "${CMAKE_SOURCE_DIR} /" )
976
-
977
973
#unit-tests
978
- add_library (unit-test-lib OBJECT ${CMAKE_SOURCE_DIR} /t/unit-tests/test-lib.c )
979
- add_library (unit-test-lib-oid OBJECT ${CMAKE_SOURCE_DIR} /t/unit-tests/lib-oid.c )
974
+ parse_makefile_for_sources (unit-test_SOURCES "UNIT_TEST_OBJS" )
975
+ list (TRANSFORM unit-test_SOURCES REPLACE "\\ $\\ (UNIT_TEST_DIR\\ )/" "${CMAKE_SOURCE_DIR} /t/unit-tests/" )
976
+ add_library (unit-test-lib STATIC ${unit-test_SOURCES} )
980
977
981
978
parse_makefile_for_scripts (unit_test_PROGRAMS "UNIT_TEST_PROGRAMS" "" )
982
979
foreach (unit_test ${unit_test_PROGRAMS} )
983
980
add_executable ("${unit_test} " "${CMAKE_SOURCE_DIR} /t/unit-tests/${unit_test} .c" )
984
- target_link_libraries ("${unit_test} " unit-test-lib unit-test-lib-oid common-main )
981
+ target_link_libraries ("${unit_test} " unit-test-lib common-main )
985
982
set_target_properties ("${unit_test} "
986
983
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /t/unit-tests/bin )
987
984
if (MSVC )
@@ -1004,14 +1001,14 @@ foreach(unit_test ${unit_test_PROGRAMS})
1004
1001
endif ()
1005
1002
endforeach ()
1006
1003
1007
- parse_makefile_for_scripts (unit_tests_SUITES "UNIT_TESTS_SUITES " "" )
1004
+ parse_makefile_for_scripts (clar_test_SUITES "CLAR_TEST_SUITES " "" )
1008
1005
1009
1006
set (clar_decls "" )
1010
1007
set (clar_cbs "" )
1011
1008
set (clar_cbs_count 0 )
1012
1009
set (clar_suites "static struct clar_suite _clar_suites[] = {\n " )
1013
- list (LENGTH unit_tests_SUITES clar_suites_count )
1014
- foreach (suite ${unit_tests_SUITES } )
1010
+ list (LENGTH clar_test_SUITES clar_suites_count )
1011
+ foreach (suite ${clar_test_SUITES } )
1015
1012
file (STRINGS "${CMAKE_SOURCE_DIR} /t/unit-tests/${suite} .c" decls
1016
1013
REGEX "^void test_${suite} __[a-zA-Z_0-9][a-zA-Z_0-9]*\\ (void\\ )$" )
1017
1014
@@ -1042,9 +1039,9 @@ string(APPEND clar_suites
1042
1039
file (WRITE "${CMAKE_BINARY_DIR} /t/unit-tests/clar-decls.h" "${clar_decls} " )
1043
1040
file (WRITE "${CMAKE_BINARY_DIR} /t/unit-tests/clar.suite" "${clar_decls} " "${clar_cbs} " "${clar_suites} " )
1044
1041
1045
- list (TRANSFORM unit_tests_SUITES PREPEND "${CMAKE_SOURCE_DIR} /t/unit-tests/" )
1046
- list (TRANSFORM unit_tests_SUITES APPEND ".c" )
1047
- add_library (unit-tests-lib ${unit_tests_SUITES } "${CMAKE_SOURCE_DIR} /t/unit-tests/clar/clar.c" )
1042
+ list (TRANSFORM clar_test_SUITES PREPEND "${CMAKE_SOURCE_DIR} /t/unit-tests/" )
1043
+ list (TRANSFORM clar_test_SUITES APPEND ".c" )
1044
+ add_library (unit-tests-lib ${clar_test_SUITES } "${CMAKE_SOURCE_DIR} /t/unit-tests/clar/clar.c" )
1048
1045
target_include_directories (unit-tests-lib PRIVATE "${CMAKE_SOURCE_DIR} /t/unit-tests" )
1049
1046
add_executable (unit-tests "${CMAKE_SOURCE_DIR} /t/unit-tests/unit-test.c" )
1050
1047
target_link_libraries (unit-tests unit-tests-lib common-main )
@@ -1062,7 +1059,7 @@ parse_makefile_for_sources(test-tool_SOURCES "TEST_BUILTINS_OBJS")
1062
1059
add_library (test -lib OBJECT ${CMAKE_SOURCE_DIR} /t/unit-tests/test-lib.c )
1063
1060
1064
1061
list (TRANSFORM test -tool_SOURCES PREPEND "${CMAKE_SOURCE_DIR} /t/helper/" )
1065
- add_executable (test -tool ${CMAKE_SOURCE_DIR} /t/helper/test-tool.c ${test-tool_SOURCES} ${test-reftable_SOURCES} )
1062
+ add_executable (test -tool ${CMAKE_SOURCE_DIR} /t/helper/test-tool.c ${test-tool_SOURCES} )
1066
1063
target_link_libraries (test -tool test -lib common-main )
1067
1064
1068
1065
set_target_properties (test -fake-ssh test -tool
0 commit comments