mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
Allow test suite to test multiple targets.
* tests/Makefile: Allow for testing multiple targets.
This commit is contained in:
parent
4e1876f294
commit
e6ac66a348
1 changed files with 11 additions and 6 deletions
|
@ -1,24 +1,29 @@
|
||||||
TESTS=$(sort $(basename $(wildcard *.c)))
|
TESTS=$(sort $(basename $(wildcard *.c)))
|
||||||
|
TARGETS=native
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -O0 -g
|
CFLAGS = -Wall -O0 -g
|
||||||
|
|
||||||
all: $(addprefix test-,$(TESTS))
|
all: $(foreach TARGET,$(TARGETS),$(addprefix test-$(TARGET)-,$(TESTS)))
|
||||||
|
|
||||||
check: all
|
check: $(addprefix test-$(TARGET),$(TARGETS))
|
||||||
|
|
||||||
|
test-%: $(addprefix test-%-,$(TESTS))
|
||||||
@echo "Running unit tests..."
|
@echo "Running unit tests..."
|
||||||
@set -e; for test in $(TESTS); do \
|
@set -e; for test in $?; do \
|
||||||
echo "Testing: $$test"; \
|
echo "Testing: $$test"; \
|
||||||
./test-$$test; \
|
./$$test; \
|
||||||
done
|
done
|
||||||
@echo "Success."
|
@echo "Success."
|
||||||
|
|
||||||
|
.PHONY: test check
|
||||||
|
|
||||||
lightening.o: ../lightening.h ../lightening/*.c
|
lightening.o: ../lightening.h ../lightening/*.c
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -o lightening.o -c ../lightening/lightening.c
|
$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -o lightening.o -c ../lightening/lightening.c
|
||||||
|
|
||||||
test-%: %.c lightening.o test.h
|
test-native-%: %.c lightening.o test.h
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -o $@ lightening.o $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) -I.. -o $@ lightening.o $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(addprefix test-,$(TESTS))
|
rm -f $(foreach TARGET,$(TARGETS),$(addprefix test-$(TARGET)-,$(TESTS)))
|
||||||
rm -f lightening.o
|
rm -f lightening.o
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue