Debian Codegraph @

test/Makefile

raw
1 GPRBUILD = gprbuild
2 GPRCLEAN = gprclean
3
4 .PHONY: all test force
5
6 all: test
7
8 RTS =
9 TARGET =
10 PROJECT_PATH_ARG =
11
12 ifeq ($(RTS),)
13 RTS = full
14 RTS_CONF =
15 else
16 RTS_CONF = --RTS=$(RTS)
17 endif
18
19 ifeq ($(TARGET),)
20 TARGET = native
21 TARGET_CONF =
22 else
23 TARGET_CONF = --target=$(TARGET)
24 endif
25
26 CONF_ARGS = $(TARGET_CONF) $(RTS_CONF)
27
28 ifeq ($(OS),Windows_NT)
29 ifeq ($(TARGET),native)
30 exeext=.exe
31 endif
32 endif
33
34 ifeq ($(findstring vxworks,$(TARGET)),vxworks)
35 exeext=.out
36 endif
37
38 RUN=
39 ifeq ($(TARGET),powerpc-elf)
40 RUN=./support/run-ppc-elf
41 endif
42
43 build:
44 $(PROJECT_PATH_ARG) $(GPRBUILD) -p -Paunit_tests $(CONF_ARGS) $(LARGS)
45
46 run: build
47 -$(RUN) ./exe/$(TARGET)-$(RTS)/aunit_harness$(exeext)
48
49 test: build
50 -$(RUN) ./exe/aunit_harness$(exeext) > test.out.full 2>&1
51 egrep "^Total|^Success|^Fail|^Unexp" test.out.full > test.out
52 diff -b test.out expected.out
53 @echo
54 @echo "[OK] AUNIT TEST IS SUCCESSFUL"
55
56 clean:
57 $(RM) -rf obj exe support/obj support/lib *.cgpr test.out
58
59 RMDIR = rmdir
60 MKDIR = mkdir -p
61 RM = rm
62 CP = cp -p