add a Makefile rule for refreshing test expected results
This commit is contained in:
parent
688fe7369e
commit
d68804f866
13
Makefile
13
Makefile
|
|
@ -1,11 +1,12 @@
|
|||
SHELL = /bin/bash
|
||||
TARGET = jumpforth
|
||||
SOURCES = $(TARGET).S
|
||||
EXTRA_DEPS = startup.4th
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(SOURCES) startup.4th
|
||||
gcc -m32 -nostdlib -static -o $@ $<
|
||||
$(TARGET): $(SOURCES) $(EXTRA_DEPS)
|
||||
gcc -m32 -nostdlib -static -o $@ $(filter-out $(EXTRA_DEPS),$^)
|
||||
|
||||
clean: test-clean
|
||||
$(RM) $(TARGET)
|
||||
|
|
@ -18,6 +19,14 @@ test: $(TEST_RESULTS)
|
|||
test-clean:
|
||||
$(RM) $(TEST_RESULTS)
|
||||
|
||||
test-refresh: $(TEST_RESULTS)
|
||||
@for act in $^; do \
|
||||
exp="$${act%.act}.exp"; \
|
||||
if ! diff -q "$$exp" "$$act" >/dev/null; then \
|
||||
echo "Refreshing $$exp"; cp -- "$$act" "$$exp"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
.PHONY: $(TEST_RESULTS)
|
||||
$(TEST_RESULTS): %.act: %.4th $(TARGET)
|
||||
@printf '%s … ' $(notdir $<) && \
|
||||
|
|
|
|||
Loading…
Reference in New Issue