From 9f390a356ea464183cc11ef44c48968ccdcd36ac Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 25 May 2011 20:22:46 +0200 Subject: unit tests: build adjustment Also define UNITTESTS macro when building unit test sources. Fixing compiler warning: external definition with no prior declaration --- tests/libtest/first.c | 3 +++ tests/libtest/test.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'tests/libtest') diff --git a/tests/libtest/first.c b/tests/libtest/first.c index a6f8e3cc2..205d3943f 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -49,7 +49,10 @@ char *libtest_arg2=NULL; char *libtest_arg3=NULL; int test_argc; char **test_argv; + +#ifdef UNITTESTS int unitfail; /* for unittests */ +#endif int main(int argc, char **argv) { diff --git a/tests/libtest/test.h b/tests/libtest/test.h index e9638a240..33d7bed83 100644 --- a/tests/libtest/test.h +++ b/tests/libtest/test.h @@ -73,3 +73,6 @@ extern int select_test(int num_fds, fd_set *rd, fd_set *wr, fd_set *exc, extern int test(char *URL); /* the actual test function provided by each individual libXXX.c file */ +#ifdef UNITTESTS +extern int unitfail; +#endif -- cgit v1.2.3