History

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.

Kirill Smelkov committed 13 years ago

Commit 031ff871 parent dbeb4fa2 files · +25 −1Browse files

Unified · Split

2 files
  1. .gitignore +3 −0
  2. tests/Makefile +22 −1
.gitignore+3−0
@@ -11,8 +11,11 @@ tc1.c · 10 unmodified lines
1111 error.c
1212 i386-gen1.c
1313 test.out1
14+test.out1b
1415 test.out2
16+test.out2b
1517 test.out3
18+test.out3b
1619 web.sh
1720 memdebug.c
1821 bench
tests/Makefile+22−1
@@ -12,6 +12,9 @@ TESTS = libtest \ · 11 unmodified lines
1212 test3 \
1313 speedtest \
1414 btest \
15+ test1b\
16+ test2b\
17+ test3b\
1518 weaktest
1619
1720 # test4 # this test does not seem to work on any platform
@@ -20,6 +23,9 @@ TESTS = libtest \ · 2 unmodified lines
2023 # bounds-checking is supported only on i386
2124 ifneq ($(ARCH),i386)
2225 TESTS := $(filter-out btest,$(TESTS))
26+ TESTS := $(filter-out test1b,$(TESTS))
27+ TESTS := $(filter-out test2b,$(TESTS))
28+ TESTS := $(filter-out test3b,$(TESTS))
2329 endif
2430
2531 # these should work too
@@ -87,18 +93,33 @@ test1: test.ref · 61 unmodified lines
8793 $(TCC) -run tcctest.c > test.out1
8894 @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
8995
96+test1b: test.ref
97+ @echo ------------ $@ ------------
98+ $(TCC) -b -run tcctest.c > test.out1b
99+ @if diff -u test.ref test.out1b ; then echo "Auto Test OK"; fi
100+
90101 # iterated test2 (compile tcc then compile tcctest.c !)
91102 test2: test.ref
92103 @echo ------------ $@ ------------
93104 $(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
94105 @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
95106
107+test2b: test.ref ../bcheck.o
108+ @echo ------------ $@ ------------
109+ $(TCC) -b $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2b
110+ @if diff -u test.ref test.out2b ; then echo "Auto Test2b OK"; fi
111+
96112 # iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
97113 test3: test.ref
98114 @echo ------------ $@ ------------
99115 $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
100116 @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
101117
118+test3b: test.ref
119+ @echo ------------ $@ ------------
120+ $(TCC) -b $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3b
121+ @if diff -u test.ref test.out3b ; then echo "Auto Test3 OK"; fi
122+
102123 # binary output test
103124 test4: test.ref
104125 @echo ------------ $@ ------------
@@ -190,5 +211,5 @@ cache: tcc_g · 85 unmodified lines
190211
191212 # clean
192213 clean:
193− rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.gcc \
214+ rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc \
194215 tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t