From 79b44cd7557f7386ed44f2b6182eadbe5037dbc1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 5 Dec 2014 07:55:16 -0800 Subject: * Makefile (TESTS_TMP): New variable. (TESTS_OUT): Depends on $(PROG). (TESTS_OK): Does not dependon $(PROG). (tests): Does not depend on tests.clean. (retest): Target removed. (%.out : %.txr): Generate to temporary file, then move to .out. (tests.clean): Remove $(TESTS_TMP). --- ChangeLog | 11 +++++++++++ Makefile | 15 +++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58174f4f..a26d6f69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2014-12-05 Kaz Kylheku + + * Makefile (TESTS_TMP): New variable. + (TESTS_OUT): Depends on $(PROG). + (TESTS_OK): Does not dependon $(PROG). + (tests): Does not depend on tests.clean. + (retest): Target removed. + (%.out : %.txr): Generate to temporary file, + then move to .out. + (tests.clean): Remove $(TESTS_TMP). + 2014-12-05 Kaz Kylheku * Makefile (SRCS): Compute from top_srcdir, so we don't get a warning diff --git a/Makefile b/Makefile index a931ffb7..877e7307 100644 --- a/Makefile +++ b/Makefile @@ -137,19 +137,17 @@ distclean: clean depend: txr $(top_srcdir)/depend.txr $(OPT_OBJS) $(DBG_OBJS) > $(top_srcdir)/dep.mk +TESTS_TMP := txr.test.out TESTS_OUT := $(patsubst $(top_srcdir)/%.txr,./%.out,\ $(shell find $(top_srcdir)/tests -name '*.txr' | sort)) TESTS_OK := $(TESTS_OUT:.out=.ok) -$(TESTS_OK): $(PROG) +$(TESTS_OUT): $(PROG) .PHONY: tests -tests: $(TESTS_OK) tests.clean +tests: $(TESTS_OK) @echo "** tests passed!" -.PHONY: retest -retest: tests.clean tests - tests/001/%: TXR_ARGS := $(top_srcdir)/tests/001/data tests/001/query-1.out: TXR_OPTS := -B tests/001/query-2.out: TXR_OPTS := -B @@ -180,8 +178,9 @@ tests/011/%: TXR_DBG_OPTS := mkdir -p $(dir $@) $(if $(TXR_SCRIPT_ON_CMDLINE),\ $(TXR) $(TXR_DBG_OPTS) $(TXR_OPTS) -c "$$(cat $<)" \ - $(TXR_ARGS) > $@,\ - $(TXR) $(TXR_DBG_OPTS) $(TXR_OPTS) $< $(TXR_ARGS) > $@) + $(TXR_ARGS) > $(TESTS_TMP),\ + $(TXR) $(TXR_DBG_OPTS) $(TXR_OPTS) $< $(TXR_ARGS) > $(TESTS_TMP)) + mv $(TESTS_TMP) $@ %.ok: %.out diff -u $(top_srcdir)/$(<:.out=.expected) $< @@ -192,7 +191,7 @@ tests/011/%: TXR_DBG_OPTS := .PHONY: tests.clean tests.clean: - @rm -f $(TESTS_OUT) $(TESTS_OK) + @rm -f $(TESTS_TMP) $(TESTS_OUT) $(TESTS_OK) define GREP_CHECK @if [ $$(grep -E $(1) $(SRCS) | wc -l) -ne $(3) ] ; then \ -- cgit v1.2.3