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
11error.c11error.c
12i386-gen1.c12i386-gen1.c
13test.out113test.out1
14test.out1b
14test.out215test.out2
16test.out2b
15test.out317test.out3
18test.out3b
16web.sh19web.sh
17memdebug.c20memdebug.c
18bench21bench
tests/Makefile+22−1
@@ -12,6 +12,9 @@ TESTS = libtest \ · 11 unmodified lines
12 test3 \12 test3 \
13 speedtest \13 speedtest \
14 btest \14 btest \
15 test1b\
16 test2b\
17 test3b\
15 weaktest18 weaktest
16 19
17 # test4 # this test does not seem to work on any platform20 # test4 # this test does not seem to work on any platform
@@ -20,6 +23,9 @@ TESTS = libtest \ · 2 unmodified lines
20# bounds-checking is supported only on i38623# bounds-checking is supported only on i386
21ifneq ($(ARCH),i386)24ifneq ($(ARCH),i386)
22 TESTS := $(filter-out btest,$(TESTS))25 TESTS := $(filter-out btest,$(TESTS))
26 TESTS := $(filter-out test1b,$(TESTS))
27 TESTS := $(filter-out test2b,$(TESTS))
28 TESTS := $(filter-out test3b,$(TESTS))
23endif29endif
24 30
25# these should work too31# these should work too
@@ -87,18 +93,33 @@ test1: test.ref · 61 unmodified lines
87 $(TCC) -run tcctest.c > test.out193 $(TCC) -run tcctest.c > test.out1
88 @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi94 @if diff -u test.ref test.out1 ; then echo "Auto Test OK"; fi
89 95
96test1b: 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
90# iterated test2 (compile tcc then compile tcctest.c !)101# iterated test2 (compile tcc then compile tcctest.c !)
91test2: test.ref102test2: test.ref
92 @echo ------------ $@ ------------103 @echo ------------ $@ ------------
93 $(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2104 $(TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out2
94 @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi105 @if diff -u test.ref test.out2 ; then echo "Auto Test2 OK"; fi
95 106
107test2b: 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
96# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)112# iterated test3 (compile tcc then compile tcc then compile tcctest.c !)
97test3: test.ref113test3: test.ref
98 @echo ------------ $@ ------------114 @echo ------------ $@ ------------
99 $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3115 $(TCC) $(RUN_TCC) $(RUN_TCC) $(RUN_TCC) -run tcctest.c > test.out3
100 @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi116 @if diff -u test.ref test.out3 ; then echo "Auto Test3 OK"; fi
101 117
118test3b: 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
102# binary output test123# binary output test
103test4: test.ref124test4: test.ref
104 @echo ------------ $@ ------------125 @echo ------------ $@ ------------
@@ -190,5 +211,5 @@ cache: tcc_g · 85 unmodified lines
190 211
191# clean212# clean
192clean:213clean:
193 rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.gcc \214 rm -vf *~ *.o *.a *.bin *.i *.ref *.out *.out? *.out?b *.gcc \
194 tcctest[1234] ex? libtcc_test$(EXESUF) tcc_g tcclib.h215 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