Alain Guibert
Mon, 31 Mar 2008 10:42:08 -0700
Hello, With an old gcc 2.7.2.1 compiler, wget 1.11.1 make test fails: | gcc -I. -I. -I./../src -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\" -O2 -Wall -DTESTING -c ../src/test.c | ../src/test.c: In function `all_tests': | ../src/test.c:51: parse error before `const' | ../src/test.c:51: `message' undeclared (first use this function) | ../src/test.c:51: (Each undeclared identifier is reported only once | ../src/test.c:51: for each function it appears in.) | ../src/test.c:52: parse error before `const' | ../src/test.c:53: parse error before `const' | ../src/test.c:54: parse error before `const' | ../src/test.c:55: parse error before `const' | ../src/test.c:56: parse error before `const' | ../src/test.c:57: parse error before `const' | make[1]: *** [test.o] Error 1 | make[1]: Leaving directory `/tmp/wget-1.11.1/tests' | make: *** [test] Error 2 The attached make-test.patch seems to fix this. However later the 3rd test fails: | ./unit-tests | RUNNING TEST test_parse_content_disposition... | PASSED | | RUNNING TEST test_subdir_p... | PASSED | | RUNNING TEST test_dir_matches_p... | test_dir_matches_p: wrong result | Tests run: 3 | make[1]: *** [run-unit-tests] Error 1 | make[1]: Leaving directory `/tmp/wget-1.11.1/tests' | make: *** [test] Error 2 Alain.
diff -prud wget-1.11.1.orig/src/test.h wget-1.11.1/src/test.h
--- wget-1.11.1.orig/src/test.h Mon Mar 24 22:53:58 2008
+++ wget-1.11.1/src/test.h Mon Mar 31 15:19:31 2008
@@ -34,8 +34,9 @@ as that of the covered work. */
#define mu_assert(message, test) do { if (!(test)) return message; } while (0)
#define mu_run_test(test) \
do { \
+ const char *message; \
puts("RUNNING TEST " #test "..."); \
- const char *message = test(); \
+ message = test(); \
tests_run++; \
if (message) return message; \
puts("PASSED\n"); \