]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: make first.c the same for both lib tests and unit tests
authorDan Fandrich <dan@coneharvesters.com>
Mon, 13 Mar 2023 01:56:22 +0000 (18:56 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 13 Mar 2023 02:14:59 +0000 (19:14 -0700)
The only difference used to be global variable used in unittest tests.
After cb7ed5a removed individual flag overrides for the unittests, first.c
was no longer recompiled for unit tests to include the flag, so whether it
worked or gave a link error depended on whether it was compiled in
libtest or unittest first. This way also speeds up the build by
eliminating 40 identical compile invocations.

Fixes #10749

tests/libtest/first.c
tests/libtest/test.h

index d4ebaaa2cfa2606caf1fcdca03e3a957cd94efaa..932d5bb654aa472930034f32376405ad010d1a65 100644 (file)
@@ -85,9 +85,7 @@ char **test_argv;
 
 struct timeval tv_test_start; /* for test timing */
 
-#ifdef UNITTESTS
 int unitfail; /* for unittests */
-#endif
 
 #ifdef CURLDEBUG
 static void memory_tracking_init(void)
index 65c44ff834389c581bd97093ca6932549cef489f..cb2d47ac7ad3f51e1d1fe8f5e3be073ff5bd0be4 100644 (file)
@@ -73,9 +73,7 @@ extern int test(char *URL); /* the actual test function provided by each
 
 extern char *hexdump(const unsigned char *buffer, size_t len);
 
-#ifdef UNITTESTS
 extern int unitfail;
-#endif
 
 /*
 ** TEST_ERR_* values must be greater than CURL_LAST CURLcode in order