From 6cd666cd5d7259368c37edfb1056929b6d441105 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sat, 16 May 2015 15:36:20 +0200 Subject: [PATCH] Add a simple test target It runs all programs/scripts, in order to just test that (especially for scripts) the correct dependencies are installed. Doing this nicely required also a bit of Makefile tweaks. --- Makefile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 977336b..5c5eecb 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,13 @@ PYTHON_INVOCS = $(foreach py,$(PYTHON_VERSIONS), \ EXTRA_RUN = /bin/true +ALL_TARGETS = \ + $(PROGS:%=./%) \ + $(SCRIPTS:%=./%) \ + $(JAVA_INVOCS) \ + $(PYTHON_INVOCS) \ + $(EXTRA_RUN) + REPS ?= 100 PERF ?= perf @@ -94,15 +101,20 @@ java/Null.class: java/Null.java Makefile javac $< log: $(PROGS) $(SCRIPTS) java/Null.class Makefile - rm -f log; \ - for prog in $(PROGS:%=./%) $(SCRIPTS:%=./%) \ - $(EXTRA_RUN) $(JAVA_INVOCS) $(PYTHON_INVOCS); do \ + @rm -f log; \ + for prog in $(ALL_TARGETS); do \ echo $$prog; \ for metric in $(METRICS); do \ LC_ALL=C $(PERF) stat -e "$$metric" -r $(REPS) -o log --append $$prog; \ done; \ done +test: $(PROGS) $(SCRIPTS) java/Null.class Makefile + @for prog in $(ALL_TARGETS); do \ + echo $$prog; \ + $$prog; \ + done + clean: cd asm && rm -f *.o cd haskell && rm -f *.hi *.o @@ -113,4 +125,4 @@ clean: report: LC_ALL=en_US.UTF-8 awk -f dump.awk log -.PHONY: log clean report +.PHONY: log clean report test -- 2.39.5