tests: Add tests for compile/run tcc.c with tcc -b
then compile tcc.c again, then run tcctest.c
Just like with test[123] add their test[123]b variants. After previous 3 patchs all test pass here on Debian GNU/Linux on i385 with gcc-4.7 with or without memory randomization turned on.
This commit is contained in:
parent
dbeb4faf21
commit
031ff872be
2 changed files with 25 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -11,8 +11,11 @@ tc1.c
|
||||||
error.c
|
error.c
|
||||||
i386-gen1.c
|
i386-gen1.c
|
||||||
test.out1
|
test.out1
|
||||||
|
test.out1b
|
||||||
test.out2
|
test.out2
|
||||||
|
test.out2b
|
||||||
test.out3
|
test.out3
|
||||||
|
test.out3b
|
||||||
web.sh
|
web.sh
|
||||||
memdebug.c
|
memdebug.c
|
||||||
bench
|
bench
|
||||||
|
|
|
@ -12,6 +12,9 @@ TESTS = libtest \
|
||||||
test3 \
|
test3 \
|
||||||
speedtest \
|
speedtest \
|
||||||
btest \
|
btest \
|
||||||
|
test1b\
|
||||||
|
test2b\
|
||||||
|
test3b\
|
||||||
weaktest
|
weaktest
|
||||||
|
|
||||||
# test4 # this test does not seem to work on any platform
|
# test4 # this test does not seem to work on any platform
|
||||||
|
@ -20,6 +23,9 @@ TESTS = libtest \
|
||||||
# bounds-checking is supported only on i386
|
# bounds-checking is supported only on i386
|
||||||
ifneq ($(ARCH),i386)
|
ifneq ($(ARCH),i386)
|
||||||
TESTS := $(filter-out btest,$(TESTS))
|
TESTS := $(filter-out btest,$(TESTS))
|
||||||
|
TESTS := $(filter-out test1b,$(TESTS))
|
||||||
|
TESTS := $(filter-out test2b,$(TESTS))
|
||||||
|
TESTS := $(filter-out test3b,$(TESTS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# these should work too
|
# these should work too
|
||||||
|
@ -87,18 +93,33 @@ test1: test.ref
|
||||||
$(TCC) -run tcctest.c > test.out1
|
$(TCC) -run tcctest.c > test.out1
|
||||||
@if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
|
@if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
|
||||||
|
|
||||||
|
test1b: test.ref
|
||||||
|
@echo ------------ $@ ------------
|
||||||
|
$(TCC) -b -run tcctest.c > test.out1b
|
||||||
|
@if diff -u test.ref test.out1b ; then echo "Auto Test OK"; fi
|
||||||
|
|
||||||
# iterated test2 (compile tcc then compile tcctest.c !)
|
# iterated test2 (compile tcc then compile tcctest.c !)
|
||||||
test2: test.ref
|
test2: test.ref
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
$(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
|
$(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
|
||||||
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
|
@if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
|
||||||
|
|
||||||
|
test2b: test.ref ../bcheck.o
|
||||||
|
@echo ------------ $@ ------------
|
||||||
|
$(TCC) -b $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2b
|
||||||
|
@if diff -u test.ref test.out2b ; then echo "Auto Test2b OK"; fi
|
||||||
|
|
||||||
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
|
# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
|
||||||
test3: test.ref
|
test3: test.ref
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
$(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
|
$(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
|
||||||
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
|
@if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
|
||||||
|
|
||||||
|
test3b: test.ref
|
||||||
|
@echo ------------ $@ ------------
|
||||||
|
$(TCC) -b $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3b
|
||||||
|
@if diff -u test.ref test.out3b ; then echo "Auto Test3 OK"; fi
|
||||||
|
|
||||||
# binary output test
|
# binary output test
|
||||||
test4: test.ref
|
test4: test.ref
|
||||||
@echo ------------ $@ ------------
|
@echo ------------ $@ ------------
|
||||||
|
@ -190,5 +211,5 @@ cache: tcc_g
|
||||||
|
|
||||||
# clean
|
# clean
|
||||||
clean:
|
clean:
|
||||||
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.gcc \
|
rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc \
|
||||||
tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h
|
tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h
|
||||||
|
|
Loading…
Reference in a new issue