Commit 8f61c0bc authored by Rusty Russell's avatar Rusty Russell

Move ccanlint tests into subdirectories.

parent 15290c3f
OBJS := tools/ccanlint/has_info.o \ TEST_CFILES := $(wildcard tools/ccanlint/compulsory_tests/*.c) \
tools/ccanlint/has_main_header.o \ $(wildcard tools/ccanlint/tests/*.c)
tools/ccanlint/has_tests.o \ TEST_OBJS := $(TEST_CFILES:.c=.o)
tools/ccanlint/trailing_whitespace.o \
tools/ccanlint/idempotent.o \
tools/ccanlint/has_info_documentation.o \
FUTURE:=tools/ccanlint/if_have_not_ifdef.o \ CORE_OBJS := tools/ccanlint/ccanlint.o \
tools/ccanlint/needs_depends.o \ tools/ccanlint/file_analysis.o \
tools/ccanlint/has_info_documentation.o \ tools/doc_extract-core.o \
tools/ccanlint/has_header_documentation.o \ ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \
tools/ccanlint/has_tests.o \ ccan/talloc/talloc.o ccan/noerr/noerr.o
tools/ccanlint/builds_ok.o \
tools/ccanlint/builds_ok_all_have_variants.o \ OBJS := $(CORE_OBJS) $(TEST_OBJS)
tools/ccanlint/run_tests.o \
tools/ccanlint/test_coverage.o \
tools/ccanlint/generated-init-tests: $(OBJS) tools/ccanlint/generated-init-tests: $(OBJS)
cat $(OBJS:.o=.c) | sed -n 's/^struct ccanlint \([A-Za-z0-9_]*\) = {/{ extern struct ccanlint \1; list_add(\&tests, \&\1.list); }/p' >$@ cat $(OBJS:.o=.c) | sed -n 's/^struct ccanlint \([A-Za-z0-9_]*\) = {/{ extern struct ccanlint \1; list_add(\&tests, \&\1.list); }/p' >$@
tools/ccanlint/ccanlint.o: tools/ccanlint/generated-init-tests tools/ccanlint/ccanlint.o: tools/ccanlint/generated-init-tests
tools/ccanlint/ccanlint: \ tools/ccanlint/ccanlint: $(OBJS)
$(OBJS) \
tools/ccanlint/ccanlint.o \
tools/ccanlint/file_analysis.o \
tools/doc_extract-core.o \
ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \
ccan/talloc/talloc.o ccan/noerr/noerr.o
ccanlint-clean: ccanlint-clean:
$(RM) tools/ccanlint/generated-init-tests $(RM) tools/ccanlint/generated-init-tests
......
#include "ccanlint.h" #include <tools/ccanlint/ccanlint.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
......
#include "ccanlint.h" #include <tools/ccanlint/ccanlint.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
......
#include "ccanlint.h" #include <tools/ccanlint/ccanlint.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
......
#include "ccanlint.h" #include <tools/ccanlint/ccanlint.h>
#include "../doc_extract.h" #include <tools/doc_extract.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
......
#include "ccanlint.h" #include <tools/ccanlint/ccanlint.h>
#include <tools/tools.h>
#include <ccan/talloc/talloc.h> #include <ccan/talloc/talloc.h>
#include <ccan/str/str.h> #include <ccan/str/str.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
#include <err.h> #include <err.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include "../tools.h"
static const char explain[] static const char explain[]
= "Headers usually start with the C preprocessor lines to prevent multiple\n" = "Headers usually start with the C preprocessor lines to prevent multiple\n"
......
/* Trailing whitespace test. Almost embarrassing, but trivial. */ /* Trailing whitespace test. Almost embarrassing, but trivial. */
#include "ccanlint.h" #include <tools/ccanlint/ccanlint.h>
#include <ccan/talloc/talloc.h> #include <ccan/talloc/talloc.h>
#include <ccan/str/str.h> #include <ccan/str/str.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment