From: Viktor Szakats Date: Wed, 25 Jun 2025 11:30:23 +0000 (+0200) Subject: build: split `.c` and `.h` file lists in tests X-Git-Tag: curl-8_15_0~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53c88435d88f7d3a590967cc243157533bb0bdb0;p=thirdparty%2Fcurl.git build: split `.c` and `.h` file lists in tests It allows to pass `.h` files only where they are really needed, which is `EXTRA_DIST` (or `*SOURCES`) for autotools. Also: - rename variables to be shorter and consistent. - drop references to non-local headers. We don't need to pass them as dist sources. - drop empty variables and references, after the above. - server: add placeholder `UTIL_H`. Closes #17745 --- diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt index 0aabacd70e..c579d24a41 100644 --- a/tests/client/CMakeLists.txt +++ b/tests/client/CMakeLists.txt @@ -22,20 +22,20 @@ # ########################################################################### -# Get BUNDLE, FIRSTFILES, CURLX_CFILES, TESTFILES variables +# Get BUNDLE, FIRST_C, FIRST_H, CURLX_C, TESTS_C variables curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") if(LIB_SELECTED STREQUAL LIB_STATIC) - set(CURLX_CFILES "") # Already exported from the libcurl static build. Skip them. + set(CURLX_C "") # Already exported from the libcurl static build. Skip them. endif() add_custom_command(OUTPUT "${BUNDLE}.c" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" - --include ${CURLX_CFILES} --test ${TESTFILES} > "${BUNDLE}.c" + --include ${CURLX_C} --test ${TESTS_C} > "${BUNDLE}.c" DEPENDS "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" - ${FIRSTFILES} ${CURLX_CFILES} ${TESTFILES} + ${FIRST_C} ${CURLX_C} ${TESTS_C} VERBATIM) add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") @@ -49,4 +49,4 @@ target_include_directories(${BUNDLE} PRIVATE set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") -curl_clang_tidy_tests(${BUNDLE} ${FIRSTFILES} ${TESTFILES}) +curl_clang_tidy_tests(${BUNDLE} ${FIRST_C} ${TESTS_C}) diff --git a/tests/client/Makefile.am b/tests/client/Makefile.am index 26ecf866a7..de445295e2 100644 --- a/tests/client/Makefile.am +++ b/tests/client/Makefile.am @@ -38,10 +38,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(srcdir) -# Get BUNDLE, FIRSTFILES, CURLX_CFILES, TESTFILES variables +# Get BUNDLE, FIRST_C, FIRST_H, CURLX_C, TESTS_C variables include Makefile.inc -EXTRA_DIST = CMakeLists.txt $(FIRSTFILES) $(TESTFILES) +EXTRA_DIST = CMakeLists.txt $(FIRST_C) $(FIRST_H) $(TESTS_C) CFLAGS += @CURL_CFLAG_EXTRAS@ @@ -54,13 +54,13 @@ endif AM_CPPFLAGS += -DCURL_NO_OLDIES if USE_CPPFLAG_CURL_STATICLIB -curlx_src = +curlx_c_lib = else # These are part of the libcurl static lib. Add them here when linking shared. -curlx_src = $(CURLX_CFILES) +curlx_c_lib = $(CURLX_C) endif -${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(curlx_src) $(TESTFILES) - @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(curlx_src) --test $(TESTFILES) > ${BUNDLE}.c +${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(curlx_c_lib) $(TESTS_C) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(curlx_c_lib) --test $(TESTS_C) > ${BUNDLE}.c noinst_PROGRAMS = $(BUNDLE) LDADD = $(top_builddir)/lib/libcurl.la diff --git a/tests/client/Makefile.inc b/tests/client/Makefile.inc index 9c6bf6d796..4ffe354e75 100644 --- a/tests/client/Makefile.inc +++ b/tests/client/Makefile.inc @@ -26,15 +26,16 @@ BUNDLE = clients # Files referenced from the bundle source -FIRSTFILES = first.c first.h +FIRST_C = first.c +FIRST_H = first.h -CURLX_CFILES = \ +CURLX_C = \ ../../lib/curlx/multibyte.c \ ../../lib/curlx/timediff.c \ ../../lib/curlx/wait.c # All test clients -TESTFILES = \ +TESTS_C = \ h2_pausing.c \ h2_serverpush.c \ h2_upgrade_extreme.c \ diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index c55b6ccb31..ea10fd1cb7 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -22,12 +22,12 @@ # ########################################################################### -# Get BUNDLE, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES, STUB_GSS variables +# Get BUNDLE, FIRST_C, FIRST_H, UTILS_C, UTILS_H, CURLX_C, TESTS_C, STUB_GSS_C, STUB_GSS_H variables curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") if(LIB_SELECTED STREQUAL LIB_STATIC) - set(CURLX_CFILES "") # Already exported from the libcurl static build. Skip them. + set(CURLX_C "") # Already exported from the libcurl static build. Skip them. endif() add_custom_command(OUTPUT "lib1521.c" @@ -37,14 +37,14 @@ add_custom_command(OUTPUT "lib1521.c" "${PROJECT_SOURCE_DIR}/include/curl/curl.h" VERBATIM) -list(APPEND TESTFILES "lib1521.c") +list(APPEND TESTS_C "lib1521.c") add_custom_command(OUTPUT "${BUNDLE}.c" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" - --include ${UTILS} ${CURLX_CFILES} --test ${TESTFILES} > "${BUNDLE}.c" + --include ${UTILS_C} ${CURLX_C} --test ${TESTS_C} > "${BUNDLE}.c" DEPENDS "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" - ${FIRSTFILES} ${UTILS} ${CURLX_CFILES} ${TESTFILES} + ${FIRST_C} ${UTILS_C} ${CURLX_C} ${TESTS_C} VERBATIM) add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") @@ -60,10 +60,10 @@ set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_ set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") -curl_clang_tidy_tests(${BUNDLE} ${FIRSTFILES} ${UTILS} ${TESTFILES}) +curl_clang_tidy_tests(${BUNDLE} ${FIRST_C} ${UTILS_C} ${TESTS_C}) if(HAVE_GSSAPI AND UNIX) - add_library(stubgss SHARED EXCLUDE_FROM_ALL ${STUB_GSS}) + add_library(stubgss SHARED EXCLUDE_FROM_ALL ${STUB_GSS_C}) set_target_properties(stubgss PROPERTIES UNITY_BUILD OFF) add_dependencies(testdeps stubgss) endif() diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index 64515c7b4c..3d3f66d125 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -39,10 +39,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(srcdir) \ -I$(top_srcdir)/tests/unit -# Get BUNDLE, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES, STUB_GSS variables +# Get BUNDLE, FIRST_C, FIRST_H, UTILS_C, UTILS_H, CURLX_C, TESTS_C, STUB_GSS_C, STUB_GSS_H variables include Makefile.inc -EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(TESTFILES) \ +EXTRA_DIST = CMakeLists.txt .checksrc $(FIRST_C) $(FIRST_H) $(UTILS_C) $(UTILS_H) $(TESTS_C) \ test307.pl test610.pl test613.pl test1013.pl test1022.pl mk-lib1521.pl CFLAGS += @CURL_CFLAG_EXTRAS@ @@ -76,19 +76,19 @@ if CURL_LT_SHLIB_USE_NO_UNDEFINED libstubgss_la_LDFLAGS += -no-undefined endif libstubgss_la_CFLAGS = $(AM_CFLAGS) -g -libstubgss_la_SOURCES = $(STUB_GSS) +libstubgss_la_SOURCES = $(STUB_GSS_C) $(STUB_GSS_H) libstubgss_la_LIBADD = libstubgss_la_DEPENDENCIES = endif if USE_CPPFLAG_CURL_STATICLIB -curlx_src = +curlx_c_lib = else # These are part of the libcurl static lib. Add them here when linking shared. -curlx_src = $(CURLX_CFILES) +curlx_c_lib = $(CURLX_C) endif -$(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(curlx_src) $(TESTFILES) lib1521.c - @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(curlx_src) --test $(TESTFILES) lib1521.c > $(BUNDLE).c +$(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(UTILS_C) $(curlx_c_lib) $(TESTS_C) lib1521.c + @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS_C) $(curlx_c_lib) --test $(TESTS_C) lib1521.c > $(BUNDLE).c noinst_PROGRAMS = $(BUNDLE) LDADD = $(top_builddir)/lib/libcurl.la diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc index 3587ecd285..59309b0687 100644 --- a/tests/libtest/Makefile.inc +++ b/tests/libtest/Makefile.inc @@ -26,12 +26,14 @@ BUNDLE = libtests # Files referenced from the bundle source -FIRSTFILES = first.c first.h +FIRST_C = first.c +FIRST_H = first.h # Common files used by test programs -UTILS = memptr.c testutil.c testutil.h testtrace.c testtrace.h test.h ../unit/curlcheck.h +UTILS_C = memptr.c testutil.c testtrace.c +UTILS_H = test.h testutil.h testtrace.h -CURLX_CFILES = \ +CURLX_C = \ ../../lib/curlx/warnless.c \ ../../lib/curlx/multibyte.c \ ../../lib/curlx/timediff.c \ @@ -41,7 +43,7 @@ CURLX_CFILES = \ ../../lib/curlx/wait.c # All libtest programs -TESTFILES = \ +TESTS_C = \ lib500.c lib501.c lib502.c lib503.c lib504.c lib505.c lib506.c lib507.c \ lib508.c lib509.c lib510.c lib511.c lib512.c lib513.c lib514.c lib515.c \ lib516.c lib517.c lib518.c lib519.c lib520.c lib521.c lib523.c lib524.c \ @@ -95,4 +97,5 @@ TESTFILES = \ lib3100.c lib3101.c lib3102.c lib3103.c lib3104.c lib3105.c \ lib3207.c lib3208.c -STUB_GSS = stub_gssapi.c stub_gssapi.h +STUB_GSS_C = stub_gssapi.c +STUB_GSS_H = stub_gssapi.h diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index d8d48d42ff..8390d316c1 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -22,16 +22,16 @@ # ########################################################################### -# Get BUNDLE, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES variables +# Get BUNDLE, FIRST_C, FIRST_H, UTILS_C, UTILS_H, CURLX_C, TESTS_C variables curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") add_custom_command(OUTPUT "${BUNDLE}.c" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" - --include ${UTILS} ${CURLX_CFILES} --test ${TESTFILES} > "${BUNDLE}.c" + --include ${UTILS_C} ${CURLX_C} --test ${TESTS_C} > "${BUNDLE}.c" DEPENDS "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" - ${FIRSTFILES} ${UTILS} ${CURLX_CFILES} ${TESTFILES} + ${FIRST_C} ${UTILS_C} ${CURLX_C} ${TESTS_C} VERBATIM) add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") @@ -55,4 +55,4 @@ if(WIN32) endif() set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") -curl_clang_tidy_tests(${BUNDLE} ${FIRSTFILES} ${UTILS} ${TESTFILES}) +curl_clang_tidy_tests(${BUNDLE} ${FIRST_C} ${UTILS_C} ${TESTS_C}) diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am index 2a4d20602b..e9444d5bc0 100644 --- a/tests/server/Makefile.am +++ b/tests/server/Makefile.am @@ -38,10 +38,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(srcdir) -# Get BUNDLE, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES variables +# Get BUNDLE, FIRST_C, FIRST_H, UTILS_C, UTILS_H, CURLX_C, TESTS_C variables include Makefile.inc -EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(TESTFILES) +EXTRA_DIST = CMakeLists.txt .checksrc $(FIRST_C) $(FIRST_H) $(UTILS_C) $(UTILS_H) $(TESTS_C) CFLAGS += @CURL_CFLAG_EXTRAS@ @@ -54,8 +54,8 @@ if DOING_NATIVE_WINDOWS AM_CPPFLAGS += -DCURL_STATICLIB endif -${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(CURLX_CFILES) $(TESTFILES) - @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(CURLX_CFILES) --test $(TESTFILES) > ${BUNDLE}.c +${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(UTILS_C) $(CURLX_C) $(TESTS_C) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS_C) $(CURLX_C) --test $(TESTS_C) > ${BUNDLE}.c noinst_PROGRAMS = $(BUNDLE) LDADD = @CURL_NETWORK_AND_TIME_LIBS@ diff --git a/tests/server/Makefile.inc b/tests/server/Makefile.inc index b21f7a5799..2e3791c774 100644 --- a/tests/server/Makefile.inc +++ b/tests/server/Makefile.inc @@ -26,12 +26,14 @@ BUNDLE = servers # Files referenced from the bundle source -FIRSTFILES = first.c first.h +FIRST_C = first.c +FIRST_H = first.h # Common files used by test programs -UTILS = memptr.c getpart.c util.c +UTILS_C = memptr.c getpart.c util.c +UTILS_H = -CURLX_CFILES = \ +CURLX_C = \ ../../lib/curlx/base64.c \ ../../lib/curlx/inet_pton.c \ ../../lib/curlx/inet_ntop.c \ @@ -46,7 +48,7 @@ CURLX_CFILES = \ ../../lib/curlx/winapi.c # All test servers -TESTFILES = \ +TESTS_C = \ dnsd.c \ mqttd.c \ resolve.c \ diff --git a/tests/tunit/CMakeLists.txt b/tests/tunit/CMakeLists.txt index bfb8776422..60e9dad7bc 100644 --- a/tests/tunit/CMakeLists.txt +++ b/tests/tunit/CMakeLists.txt @@ -22,16 +22,16 @@ # ########################################################################### -# Get BUNDLE, FIRSTFILES, UTILS, TESTFILES variables +# Get BUNDLE, FIRST_C, TESTS_C variables curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") add_custom_command(OUTPUT "${BUNDLE}.c" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" - --include ${UTILS} --test ${TESTFILES} > "${BUNDLE}.c" + --test ${TESTS_C} > "${BUNDLE}.c" DEPENDS "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" - ${FIRSTFILES} ${UTILS} ${TESTFILES} + ${FIRST_C} ${TESTS_C} VERBATIM) add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") @@ -49,4 +49,4 @@ set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_ set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") -curl_clang_tidy_tests(${BUNDLE} ${FIRSTFILES} ${UTILS} ${TESTFILES}) +curl_clang_tidy_tests(${BUNDLE} ${FIRST_C} ${TESTS_C}) diff --git a/tests/tunit/Makefile.am b/tests/tunit/Makefile.am index 23472085ed..857f7ffeef 100644 --- a/tests/tunit/Makefile.am +++ b/tests/tunit/Makefile.am @@ -41,10 +41,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_srcdir)/tests/unit \ -I$(srcdir) -# Get BUNDLE, FIRSTFILES, UTILS, TESTFILES variables +# Get BUNDLE, FIRST_C, TESTS_C variables include Makefile.inc -EXTRA_DIST = CMakeLists.txt README.md $(UTILS) $(TESTFILES) +EXTRA_DIST = CMakeLists.txt README.md $(TESTS_C) CFLAGS += @CURL_CFLAG_EXTRAS@ @@ -61,8 +61,8 @@ endif AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION if BUILD_UNITTESTS -${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(TESTFILES) - @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) --test $(TESTFILES) > ${BUNDLE}.c +${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(TESTS_C) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl --test $(TESTS_C) > ${BUNDLE}.c noinst_PROGRAMS = $(BUNDLE) LDADD = $(top_builddir)/src/libcurltool.la $(top_builddir)/lib/libcurl.la diff --git a/tests/tunit/Makefile.inc b/tests/tunit/Makefile.inc index e606c94851..adf66c43e9 100644 --- a/tests/tunit/Makefile.inc +++ b/tests/tunit/Makefile.inc @@ -26,13 +26,10 @@ BUNDLE = tunits # Files referenced from the bundle source -FIRSTFILES = ../libtest/first.c ../libtest/first.h - -# Common files used by test programs -UTILS = ../unit/curlcheck.h +FIRST_C = ../libtest/first.c # All tool unit test programs -TESTFILES = \ +TESTS_C = \ tool1394.c \ tool1604.c \ tool1621.c diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 39f1443cd9..f1585f4dda 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -22,16 +22,16 @@ # ########################################################################### -# Get BUNDLE, FIRSTFILES, UTILS, TESTFILES variables +# Get BUNDLE, FIRST_C, UTILS_H, TESTS_C variables curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") add_custom_command(OUTPUT "${BUNDLE}.c" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" - --include ${UTILS} --test ${TESTFILES} > "${BUNDLE}.c" + --test ${TESTS_C} > "${BUNDLE}.c" DEPENDS "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" - ${FIRSTFILES} ${UTILS} ${TESTFILES} + ${FIRST_C} ${TESTS_C} VERBATIM) add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") @@ -49,4 +49,4 @@ set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_OLDIE set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "BUILDING_LIBCURL") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") -curl_clang_tidy_tests(${BUNDLE} ${FIRSTFILES} ${UTILS} ${TESTFILES}) +curl_clang_tidy_tests(${BUNDLE} ${FIRST_C} ${TESTS_C}) diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 20385016fc..fb30741466 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -39,10 +39,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_srcdir)/tests/libtest \ -I$(srcdir) -# Get BUNDLE, FIRSTFILES, UTILS, TESTFILES variables +# Get BUNDLE, FIRST_C, UTILS_H, TESTS_C variables include Makefile.inc -EXTRA_DIST = CMakeLists.txt README.md $(UTILS) $(TESTFILES) +EXTRA_DIST = CMakeLists.txt README.md $(UTILS_H) $(TESTS_C) CFLAGS += @CURL_CFLAG_EXTRAS@ @@ -60,8 +60,8 @@ AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION AM_CPPFLAGS += -DBUILDING_LIBCURL if BUILD_UNITTESTS -${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(TESTFILES) - @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) --test $(TESTFILES) > ${BUNDLE}.c +${BUNDLE}.c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(TESTS_C) + @PERL@ $(top_srcdir)/scripts/mk-unity.pl --test $(TESTS_C) > ${BUNDLE}.c noinst_PROGRAMS = $(BUNDLE) LDADD = $(top_builddir)/lib/libcurlu.la diff --git a/tests/unit/Makefile.inc b/tests/unit/Makefile.inc index 6bf388e794..e01980e9cc 100644 --- a/tests/unit/Makefile.inc +++ b/tests/unit/Makefile.inc @@ -26,13 +26,13 @@ BUNDLE = units # Files referenced from the bundle source -FIRSTFILES = ../libtest/first.c ../libtest/first.h +FIRST_C = ../libtest/first.c # Common files used by test programs -UTILS = curlcheck.h +UTILS_H = curlcheck.h # All unit test programs -TESTFILES = \ +TESTS_C = \ unit1300.c unit1302.c unit1303.c unit1304.c unit1305.c \ unit1307.c unit1309.c \ unit1323.c unit1330.c \