Commit dcdb0302 authored by Kirill Smelkov's avatar Kirill Smelkov

tests: Don't forget to depend on ccan's config.h

Else, in a clean repo the tests do not build from scratch:

    $ make test
    x86_64-linux-gnu-gcc -pthread -g -Wall -D_GNU_SOURCE -std=gnu99 -fplan9-extensions -Wno-declaration-after-statement -Wno-error=declaration-after-statement  -Iinclude -I3rdparty/ccan -I3rdparty/include   bigfile/tests/test_virtmem.c lib/bug.c lib/utils.c 3rdparty/ccan/ccan/tap/tap.c  -o bigfile/tests/test_virtmem.t
    In file included from include/wendelin/list.h:11:0,
                     from include/wendelin/bigfile/virtmem.h:33,
                     from bigfile/tests/../virtmem.c:23,
                     from bigfile/tests/test_virtmem.c:21:
    3rdparty/ccan/ccan/array_size/array_size.h:4:20: fatal error: config.h: No such file or directory
     #include "config.h"
                        ^
    compilation terminated.
    3rdparty/ccan/ccan/tap/tap.c:26:20: fatal error: config.h: No such file or directory
     #include "config.h"
                        ^
    compilation terminated.
    Makefile:99: recipe for target 'bigfile/tests/test_virtmem.t' failed
    make: *** [bigfile/tests/test_virtmem.t] Error 1
parent ca064f75
...@@ -34,7 +34,9 @@ endif ...@@ -34,7 +34,9 @@ endif
all : bigfile/_bigfile.so all : bigfile/_bigfile.so
bigfile/_bigfile.so : 3rdparty/ccan/config.h FORCE ccan_config := 3rdparty/ccan/config.h
bigfile/_bigfile.so : $(ccan_config) FORCE
$(PYTHON) setup.py ll_build_ext --inplace $(PYTHON) setup.py ll_build_ext --inplace
...@@ -42,7 +44,7 @@ FORCE : ...@@ -42,7 +44,7 @@ FORCE :
# TODO add FORCE? # TODO add FORCE?
3rdparty/ccan/config.h: 3rdparty/ccan/Makefile $(ccan_config): 3rdparty/ccan/Makefile
$(MAKE) -C $(@D) $(@F) $(MAKE) -C $(@D) $(@F)
# if there is no ccan/Makefile - ccan submodule has not been initialized # if there is no ccan/Makefile - ccan submodule has not been initialized
...@@ -88,14 +90,14 @@ xrun = $1 $(if $(XFAIL_$@),|| echo "($@ - expected failure)") ...@@ -88,14 +90,14 @@ xrun = $1 $(if $(XFAIL_$@),|| echo "($@ - expected failure)")
XRUN< = $(call xrun,$(call runwith,$<) $<) XRUN< = $(call xrun,$(call runwith,$<) $<)
LINKC = $(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@ LINKC = $(LINK.c) $< $(LOADLIBES) $(LDLIBS) -o $@
# tests without instrumentation # tests without instrumentation
test.t : $(TESTS:%=%.trun) test.t : $(TESTS:%=%.trun)
%.trun : %.t %.trun : %.t
$(XRUN<) $(XRUN<)
%.t : %.c %.t : %.c $(ccan_config)
$(LINKC) $(LINKC)
# test with AddressSanitizer # test with AddressSanitizer
...@@ -104,7 +106,7 @@ test.asan: $(TESTS:%=%.asanrun) ...@@ -104,7 +106,7 @@ test.asan: $(TESTS:%=%.asanrun)
$(XRUN<) $(XRUN<)
%.asan : CFLAGS += -fsanitize=address %.asan : CFLAGS += -fsanitize=address
%.asan : %.c %.asan : %.c $(ccan_config)
$(LINKC) $(LINKC)
...@@ -124,7 +126,7 @@ endif ...@@ -124,7 +126,7 @@ endif
%.tsan : CFLAGS += -fsanitize=thread -pie -fPIC %.tsan : CFLAGS += -fsanitize=thread -pie -fPIC
%.tsan : %.c %.tsan : %.c $(ccan_config)
$(LINKC) $(LINKC)
......
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