0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00

Setting up the netlab tests to run from the main Makefile

The bird-tools repository must be initialized as a submodule if the
tests should run. If it is checked out, `make test` runs them. If not,
then not.
This commit is contained in:
Maria Matejka 2022-06-15 17:36:54 +02:00
parent 9e60b500c7
commit 2b337cfa8c
3 changed files with 9 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "bird-tools"]
path = bird-tools
url = https://gitlab.nic.cz/labs/bird-tools

View File

@ -84,6 +84,7 @@ cf-local = $(conf-y-targets): $(s)config.Y
src-o-files = $(patsubst %.c,$(o)%.o,$(src)) src-o-files = $(patsubst %.c,$(o)%.o,$(src))
tests-target-files = $(patsubst %.c,$(o)%,$(tests_src)) tests-target-files = $(patsubst %.c,$(o)%,$(tests_src))
tests_targets_ok :=
all-daemon = $(daemon): $(obj) all-daemon = $(daemon): $(obj)
all-client = $(client): $(obj) all-client = $(client): $(obj)
@ -167,7 +168,7 @@ $(objdir)/sysdep/paths.h: Makefile
# Unit tests rules # Unit tests rules
tests_targets_ok = $(addsuffix .ok,$(tests_targets)) tests_targets_ok += $(addsuffix .ok,$(tests_targets))
$(tests_targets): %: %.o $(tests_objs) | prepare $(tests_targets): %: %.o $(tests_objs) | prepare
$(E)echo LD $(LDFLAGS) -o $@ $< "..." $(LIBS) $(E)echo LD $(LDFLAGS) -o $@ $< "..." $(LIBS)
@ -179,6 +180,9 @@ $(tests_targets): LIBS += $(DAEMON_LIBS)
$(tests_targets_ok): %.ok: % $(tests_targets_ok): %.ok: %
$(Q)$* 2>/dev/null && touch $*.ok $(Q)$* 2>/dev/null && touch $*.ok
# Include the netlab testsuite target listing
-include bird-tools/netlab/runtests.mk
test: testsclean check test: testsclean check
check: tests tests_run check: tests tests_run
tests: $(tests_targets) tests: $(tests_targets)

1
bird-tools Submodule

@ -0,0 +1 @@
Subproject commit 94362b27e7fad080f6262aa26c532ee42343af69