guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/09: Allow test suite to test multiple targets.


From: Andy Wingo
Subject: [Guile-commits] 01/09: Allow test suite to test multiple targets.
Date: Wed, 24 Apr 2019 10:04:20 -0400 (EDT)

wingo pushed a commit to branch lightening
in repository guile.

commit e6ac66a3487822beaffdb0e8259ea91c01b5bf6e
Author: Andy Wingo <address@hidden>
Date:   Fri Apr 5 16:07:01 2019 +0200

    Allow test suite to test multiple targets.
    
    * tests/Makefile: Allow for testing multiple targets.
---
 tests/Makefile | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index e94c6fd..8527065 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,24 +1,29 @@
 TESTS=$(sort $(basename $(wildcard *.c)))
+TARGETS=native
 
 CC = gcc
 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..."
-       @set -e; for test in $(TESTS); do \
+       @set -e; for test in $?; do \
          echo "Testing: $$test"; \
-         ./test-$$test; \
+         ./$$test; \
        done
        @echo "Success."
 
+.PHONY: test check
+
 lightening.o: ../lightening.h ../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 $<
 
 clean:
-       rm -f $(addprefix test-,$(TESTS))
+       rm -f $(foreach TARGET,$(TARGETS),$(addprefix test-$(TARGET)-,$(TESTS)))
        rm -f lightening.o



reply via email to

[Prev in Thread] Current Thread [Next in Thread]