diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-12-05 07:55:16 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-12-05 07:55:16 -0800 |
commit | 79b44cd7557f7386ed44f2b6182eadbe5037dbc1 (patch) | |
tree | f1aaa2aed6691514974d00720578e3285e6db620 | |
parent | a4be9ff0a1e6e7d943d5a2b6f0736aa1f08d9ca2 (diff) | |
download | txr-79b44cd7557f7386ed44f2b6182eadbe5037dbc1.tar.gz txr-79b44cd7557f7386ed44f2b6182eadbe5037dbc1.tar.bz2 txr-79b44cd7557f7386ed44f2b6182eadbe5037dbc1.zip |
* 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).
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | Makefile | 15 |
2 files changed, 18 insertions, 8 deletions
@@ -1,5 +1,16 @@ 2014-12-05 Kaz Kylheku <kaz@kylheku.com> + * 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 <kaz@kylheku.com> + * Makefile (SRCS): Compute from top_srcdir, so we don't get a warning from git, and "make enforce" works from out of three builds. @@ -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 \ |