Home | History | Annotate | Download | only in layout
      1 # Usage: make test.N.report 
      2 #
      3 # COUNT can be over-ridden to change the number of tests generated per
      4 # file, and TESTARGS is used to change the type generation. Make sure
      5 # to 'make clean' after changing either of these parameters.
      6 
      7 ABITESTGEN := ../ABITestGen.py
      8 TESTARGS := --max-args 0 --test-layout
      9 COUNT := 1000
     10 TIMEOUT := 5
     11 
     12 CFLAGS := -std=gnu99
     13 
     14 X_COMPILER := llvm-gcc
     15 Y_COMPILER := clang
     16 CC := gcc
     17 
     18 ifeq (0, 0)
     19 X_CFLAGS := -m32
     20 Y_CFLAGS := -m32
     21 CC_CFLAGS := -m32
     22 else
     23 X_CFLAGS := -m64
     24 Y_CFLAGS := -m64
     25 CC_CFLAGS := -m64
     26 endif
     27 
     28 .PHONY: test.%.report
     29 test.%.report: test.%.x.diff test.%.y.diff
     30 	@for t in $^; do \
     31 		if [ -s $$t ]; then \
     32 			echo "TEST $*: $$t failed"; \
     33 		fi; \
     34 	done
     35 
     36 .PHONY: test.%.build
     37 test.%.build: test.%.ref test.%.x test.%.y
     38 	@true
     39 
     40 ###
     41 
     42 .PRECIOUS: test.%.x.diff
     43 test.%.x.diff: test.%.ref.out test.%.x.out
     44 	-diff $^ > $@
     45 .PRECIOUS: test.%.y.diff
     46 test.%.y.diff: test.%.ref.out test.%.y.out
     47 	-diff $^ > $@
     48 
     49 .PRECIOUS: test.%.out
     50 test.%.out: test.%
     51 	-./$< > $@
     52 
     53 .PRECIOUS: test.%.ref
     54 test.%.ref: test.%.c
     55 	$(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^
     56 .PRECIOUS: test.%.x
     57 test.%.x: test.%.c
     58 	$(X_COMPILER) $(CFLAGS) $(X_CFLAGS) -o $@ $^
     59 .PRECIOUS: test.%.y
     60 test.%.y: test.%.c
     61 	$(Y_COMPILER) $(CFLAGS) $(Y_CFLAGS) -o $@ $^
     62 
     63 .PRECIOUS: test.%.c
     64 test.%.c: $(ABITESTGEN)
     65 	$(ABITESTGEN) $(TESTARGS) -o $@ --min=$(shell expr $* '*' $(COUNT))  --count=$(COUNT)
     66 
     67 clean:	
     68 	rm -f test.* *~
     69