forked from larsbrinkhoff/lbForth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
check.mk
57 lines (42 loc) · 1.71 KB
/
check.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
CHECKS = test-standard test-6502-asm test-pdp11-asm test-avr-asm \
test-image test-save-image test-meta test-lib test-copyright
MORE_CHECKS = test-x86-asm test-m68k-asm test-msp430-asm test-arm-asm \
test-riscv-asm test-exe
RUNTFORTH = $(TDIR)/run.sh ./$(TFORTH)
check: check-16-bit $(MORE_CHECKS)
check-16-bit: $(CHECKS)
recheck: t-clean check
test-standard: test-errors $(TDIR)/expected-errors
test `cat $<` -eq `cat $(TDIR)/expected-errors` && touch $@
test-errors: test-output
$(GREP) $(ERROR_PATTERNS) $< | wc -l > $@
test-output: test/test-input src/core.fth test-smoke
$(RUNTFORTH) < $< > $@
$(GREP) Test-OK $@
test-%-asm: test/test-%-asm.fth targets/%/asm.fth test-smoke
echo 'include $< .( Asm-OK )' | $(RUNTFORTH) > $@
$(GREP) Asm-OK $@
test-smoke: $(TFORTH)
echo 'words cr .( Smoke-OK )' | $(RUNTFORTH) > $@
$(GREP) Smoke-OK $@
test-image: test/test-image.fth lib/image.fth test-smoke
echo 'include $< .( Image-OK )' | $(RUNTFORTH) > $@
$(GREP) Image-OK $@
test-save-image: test/test-save-image.fth lib/save-image.fth test-smoke
echo 'include $<' | $(RUNTFORTH) > /dev/null
# This only works with ELF images so far.
if [ "$$OS" = linux ]; then \
chmod a+x test-save-image; \
$(TDIR)/run.sh ./test-save-image | $(GREP) Save-Image-OK; \
fi
test-exe: test/test-exe.sh test/test-elf.fth test/test-pe.fth targets/x86/asm.fth lib/elf.fth lib/pe.fth test-smoke
FORTH="$(RUNTFORTH)" TARGET="$(TARGET)" ./test/test-exe.sh > $@
$(GREP) 42 $@
test-lib: lib/README test/test-lib.sh
sh test/test-lib.sh && touch $@
test-meta: $(META) $(DEPS) test-smoke
echo 'include $< bye' | $(RUNTFORTH) | tail -n+3 > $@
-mv image $@
-cmp $@ $(META-OUTPUT)
test-copyright:
sh test/test-copyright.sh && touch $@