Move unit-test code to tests/

* src/Makefile.am: Remove test.c and test.h
* src/test.c: Rename to tests/unit-tests.c
* src/test.h: Rename to tests/unit-tests.h
* tests/Makefile.am: Add unit-tests.c and unit-tests.h
* src/hsts.c: Amend #include
* src/http.c: Likewise
* src/init.c: Likewise
* src/metalink.c: Likewise
* src/res.c: Likewise
* src/url.c: Likewise
* src/utils.c: Likewise
This commit is contained in:
Tim Rühsen 2018-02-09 12:42:19 +01:00
parent 3e84963e84
commit de54c970b2
11 changed files with 11 additions and 14 deletions

View File

@ -101,7 +101,7 @@ distclean-local:
rm -f css.c css_.c
check_LIBRARIES = libunittest.a
libunittest_a_SOURCES = $(wget_SOURCES) test.c build_info.c test.h
libunittest_a_SOURCES = $(wget_SOURCES) build_info.c
nodist_libunittest_a_SOURCES = version.c
libunittest_a_CPPFLAGS = -DTESTING "-I$(top_builddir)/lib" "-I$(top_srcdir)/lib"
libunittest_a_LIBADD = $(LIBOBJS)

View File

@ -36,7 +36,7 @@ as that of the covered work. */
#include "hash.h"
#include "c-ctype.h"
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif
#include <unistd.h>

View File

@ -71,7 +71,7 @@ as that of the covered work. */
#endif
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif
#ifdef __VMS

View File

@ -72,7 +72,7 @@ as that of the covered work. */
#include "c-strcase.h"
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif

View File

@ -53,7 +53,7 @@ as that of the covered work. */
#endif
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif
/* Loop through all files in metalink structure and retrieve them.

View File

@ -84,7 +84,7 @@ as that of the covered work. */
#include "c-strcase.h"
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif
struct path_info {

View File

@ -51,7 +51,7 @@ as that of the covered work. */
#endif /* def __VMS */
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif
enum {

View File

@ -103,7 +103,7 @@ as that of the covered work. */
#endif /* def __VMS */
#ifdef TESTING
#include "test.h"
#include "../tests/unit-tests.h"
#endif
#include "exits.h"

View File

@ -142,11 +142,12 @@ EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
certs valgrind-suppressions valgrind-suppressions-ssl
check_PROGRAMS = unit-tests
unit_tests_SOURCES =
unit_tests_SOURCES = unit-tests.c unit-tests.h
LDADD = ../src/libunittest.a ../lib/libgnu.a $(GETADDRINFO_LIB) $(HOSTENT_LIB)\
$(INET_NTOP_LIB) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO)\
$(LIB_NANOSLEEP) $(LIB_POSIX_SPAWN) $(LIB_SELECT) $(LIBICONV) $(LIBINTL)\
$(LIBTHREAD) $(LIBUNISTRING) $(SERVENT_LIB)
AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib -DLOCALEDIR=\"$(localedir)\"
CLEANFILES = *~ *.bak core core.[0-9]*

View File

@ -34,11 +34,7 @@ as that of the covered work. */
# include <locale.h>
#endif
#include "test.h"
#ifndef TESTING
#error "TESTING not set!!!"
#endif
#include "unit-tests.h"
const char *program_argstring = "TEST";