1 #****h* ROBODoc/SystemTest
3 # The systemtest is a series of tests that test the
4 # behaviour of robodoc and robohdrs.
6 # Most tests consists of:
7 # * One or more data files (.dat)
8 # * One or more result files (.html etc). The result files are generated
9 # by running robodoc on the .dat files. Or sometimes on whole
10 # directories with source files.
11 # * A perl script that checks the results and prints either OK or FAIL
12 # For instance there is a test that checks if robodoc correctly
13 # recognizes all Item names. The data files for this is
14 # item_test.dat. It contains all item names with in between
16 # where dd is a number from 1 to 43
18 # Robodoc is run on this data file and a file
19 # called item_test.html is generated. A script called item_test.pl
20 # scans this .html file finds all the "testmark dd"s and check if
21 # all number from 1 to 43 occur. If so it prints OK if not it
24 # To run the test do a
27 # To cleanup all the generated files do a
31 # $Id: makefile,v 1.54 2007/01/29 22:23:53 gumpu Exp $
35 # The programs to be tested.
38 ROBOHDRS = ../robohdrs
40 # No unnecessary output.
43 all: permissions clean test
56 html_specialchar_test \
58 internalheader_test2 \
59 latex_specialchar_test \
66 user_specified_css_file_test \
78 # temporarily excluded: parameter_test
83 # These test error handling, but they are not
85 # error_missing_header_end_test
86 # error_missing_header_end_test_2
92 clean: doc1_clean doc2_clean
93 -rm -f *.res *.html *.tex *.rtf *.xml *.toc *.log *.idx *.dvi *.aux *.pdf
95 -rm -rf outputformat_test.txt
97 -rm -rf RoboHeaders/*.c
98 -rm -rf robohdrs_test.hdrs
99 -rm -rf cmode_test1.css
100 -rm -rf header_size_test.css
101 -rm -rf header_test2.css
102 -rm -rf header_test3.css
103 -rm -rf header_test4.css
104 -rm -rf header_test.css
105 -rm -rf html_specialchar_test2.css
106 -rm -rf html_specialchar_test.css
107 -rm -rf internalheader_test2.css
108 -rm -rf internalheader_test.css
109 -rm -rf item_test.css
110 -rm -rf link_test.css
111 -rm -rf lock_test.css
112 -rm -rf outputformat_test.css
113 -rm -rf parameter_test.css
114 -rm -rf pipe_test.css
115 -rm -rf remarkmarker_test.css
118 -rm -rf forth_test.css
119 -rm -rf error_test.css
120 -rm -rf ignore_test.css
121 -rm -rf nosource_test.css
125 # Test the handling of HTML reserver characters.
127 html_specialchar_test : html_specialchar_test.html html_specialchar_test2.html
128 ./$(@F).pl < html_specialchar_test.html
129 ./$(@F).pl < html_specialchar_test2.html
131 html_specialchar_test.html : html_specialchar_test.dat
132 $(ROBODOC) --src html_specialchar_test.dat --doc html_specialchar_test --html --singlefile
134 html_specialchar_test2.html : html_specialchar_test.dat
135 $(ROBODOC) --src html_specialchar_test.dat --doc html_specialchar_test2 --html --singlefile --sections --toc
137 #****e* SystemTest/latex_specialchar_test
139 # Create input for testing the handling of latex reserved characters
142 latex_specialchar_test : latex_specialchar_test.tex latex_specialchar_test2.tex
143 ./$(@F).pl < latex_specialchar_test.tex
144 ./$(@F).pl < latex_specialchar_test2.tex
146 latex_specialchar_test.tex : latex_specialchar_test.dat
147 $(ROBODOC) --src latex_specialchar_test.dat --doc latex_specialchar_test --latex --singlefile
149 latex_specialchar_test2.tex : latex_specialchar_test.dat
150 $(ROBODOC) --src latex_specialchar_test.dat --doc latex_specialchar_test2 --latex --singlefile --sections --toc
155 #****e* SystemTest/header_size_test
157 # Create the input file for header_size_test_pl.
160 header_size_test : header_size_test.html
161 ./$(@F).pl < header_size_test.html
163 header_size_test.html : header_size_test.dat
164 $(ROBODOC) --src $< --doc header_size_test --html --singlefile
169 #****e* SystemTest/internalheader_test, internalheader_test2
171 # Create the input for the internalheader_test.
174 internalheader_test : internalheader_test.html
175 ./$(@F).pl < internalheader_test.html
177 internalheader_test.html : internalheader_test.dat
178 $(ROBODOC) --src internalheader_test.dat --doc internalheader_test --html --singlefile --index --toc --internal
181 internalheader_test2 : internalheader_test2.html
182 ./$(@F).pl < internalheader_test2.html
184 internalheader_test2.html : internalheader_test.dat
185 $(ROBODOC) --src internalheader_test.dat --doc internalheader_test2 --html --singlefile --index --toc
192 outputformat_test : outputformat_test.html \
193 outputformat_test.txt \
194 outputformat_test.rtf
195 # outputformat_test_dbsgml.res \
196 # outputformat_test_troff.res
200 outputformat_test.html : outputformat_test.dat
201 $(ROBODOC) --src $< --doc outputformat_test --singlefile --html
203 outputformat_test.txt : outputformat_test.dat
204 $(ROBODOC) --src $< --doc outputformat_test --singlefile --ascii
206 outputformat_test.rtf : outputformat_test.dat
207 $(ROBODOC) --src $< --doc outputformat_test --singlefile --rtf
209 # outputformat_test.dbsgml : outputformat_test.dat
210 # $(ROBODOC) --src $< --doc $@ DBSGML
212 # outputformat_test_troff.res : outputformat_test.dat
213 # $(ROBODOC) --src $< --doc $@ TROFF
217 # Test if we recognize all predefined items.
219 item_test : item_test.html
220 ./$(@F).pl < item_test.html
222 item_test.html : item_test.dat
223 $(ROBODOC) --src item_test.dat --doc item_test --html --singlefile
226 # Test the linking of keywords to headers.
228 link_test : link_test.html
229 ./$(@F).pl < link_test.html
231 link_test.html : link_test.dat
232 $(ROBODOC) --src link_test.dat --doc link_test --html --singlefile
234 #****e* SystemTest/header_test, header_test2, header_test3, header_test4, header_test5
236 # Create the input file for header_test_pl.
239 header_test : header_test.html
240 ./$(@F).pl < header_test.html
242 header_test.html : header_test.dat
243 $(ROBODOC) --src header_test.dat --doc header_test --html --toc --singlefile
247 # indented header test case
249 header_test2 : header_test2.html
250 ./header_test2.pl < header_test2.html
252 header_test2.html : header_test2.dat
253 $(ROBODOC) --src header_test2.dat --doc header_test2 --html --toc --singlefile
256 # indented header test case
258 header_test3 : header_test3.html
259 ./header_test3.pl < header_test3.html
261 header_test3.html : header_test3.dat
262 $(ROBODOC) --src header_test3.dat --doc header_test3 --html --toc --singlefile
264 header_test4 : header_test4.tst
265 ./$(@F).pl < header_test4.tst
267 header_test4.tst : header_test4.dat
268 $(ROBODOC) --src header_test4.dat --doc header_test4 --test --toc --singlefile
270 header_test5 : header_test5.tst
271 ./$(@F).pl < header_test5.tst
273 header_test5.tst : header_test5.dat
274 $(ROBODOC) --rc header_test5.rc --src header_test5.dat --doc header_test5 --test --toc --singlefile
279 # Test if we can recognize all the different remark markers for
280 # all the languages we defined.
282 remarkmarker_test : remarkmarker_test.html
283 ./$(@F).pl < remarkmarker_test.html
285 remarkmarker_test.html : remarkmarker_test.dat
286 $(ROBODOC) --src remarkmarker_test.dat --doc remarkmarker_test --html --singlefile
289 # Test the automatic recognition of urls
291 url_test : url_test.html
292 ./$(@F).pl < url_test.html
294 url_test.html : url_test.dat
295 $(ROBODOC) --src url_test.dat --doc url_test --html --singlefile
298 # Test the syntax colouring of C code.
300 cmode_test : cmode_test1.html
301 ./cmode_test1.pl < cmode_test1.html
303 cmode_test1.html : cmode_test.dat
304 $(ROBODOC) --src cmode_test.dat --doc cmode_test1 --html --cmode --singlefile
307 # Test the --multidoc mode
310 multidoc_test1 : multidoc_test1.html
313 multidoc_test1.html :
314 $(ROBODOC) --src ./Scr1 --doc ./Doc1 --html --multidoc --index --sections --toc
315 touch multidoc_test1.html
319 # This tests if specifying the tabsize with --tabsize works.
321 tabtest : tabtest.html
322 ./$(@F).pl < tabtest.html
324 tabtest.html : tabtest.dat
325 $(ROBODOC) --src tabtest.dat --doc tabtest --html --singlefile --tabsize 4
328 # This test if we can specify a full path to the source file
329 # when we use --singlefile. (This borrows the code from tabtest)
331 parameter_test : parameter_test.html
334 parameter_test.html : parameter_test.dat
335 $(ROBODOC) --src /home/robodoc/robo/Source/Test/parameter_test.dat --doc /home/robodoc/robo/Source/Test/parameter_test --html --singlefile
338 # The xml file uses UTF-8 encoding. Although xmlto seems not to _write_
339 # UTF-8, it does _read_ that correctly in input and complains if that is
340 # not proper UTF-8 format.
342 encoding_test: encoding_test.html
343 @ if [ -x "`which xmlto`" ] ; then \
344 xmlto html-nochunks encoding_test.xml ; \
346 echo "xmlto missing, can not perform test"; \
348 #rm -f encoding_test.html encoding_test.xml encoding_test.pdf
350 # Source file uses Latin-1 i.e. iso-8859-1 encoding
351 encoding_test.html: encoding_test.dat
352 $(ROBODOC) --src encoding_test.dat --doc encoding_test --singlefile --dbxml
356 # Test if we can specify an alternative robodoc.rc file using
360 option_rc_test: option_rc_test.html
361 ./$(@F).pl < option_rc_test.html
363 option_rc_test.html: alt_rc_file.rc
364 $(ROBODOC) --rc alt_rc_file.rc --html
368 # Test the error generated for a header end messing from a header
369 # that is not the last header in a file.
372 error_missing_header_end_test: error_missing_header_end_test.stderr
375 error_missing_header_end_test.stderr : error_missing_header_end_test.dat
376 -$(ROBODOC) --src error_missing_header_end_test.dat --doc error_test --singlefile --html 2> error_missing_header_end_test.stderr
379 # Test the error generated for a header end missing from a header
380 # that _is_ the last header in a file.
383 error_missing_header_end_test_2: error_missing_header_end_test_2.stderr
386 error_missing_header_end_test_2.stderr : error_missing_header_end_test_2.dat
387 -$(ROBODOC) --src error_missing_header_end_test_2.dat --doc error_test --singlefile --html 2> error_missing_header_end_test_2.stderr
391 # The if a user can specify its own css file.
394 user_specified_css_file_test : user_specified_css_file_test.html
395 ./$(@F).pl < ./Doc1/robodoc.css
397 user_specified_css_file_test.html : user_css.css
398 $(ROBODOC) --src ./Scr1 --doc ./Doc1 --html --multidoc --index --sections --toc --css user_css.css
399 # touch user_specified_css_file_test.html
402 lock_test : lock_test.html
403 ./$(@F).pl < lock_test.html
405 lock_test.html: lock_test.dat
406 $(ROBODOC) --src lock_test.dat --doc lock_test --singlefile --lock --html
409 # Test the forth headers
412 forth_test: forth_test.html
415 $(ROBODOC) --src ../../Headers/forth.sample --doc forth_test --singlefile --html --toc
422 $(ROBODOC) --src pipe_test.dat --doc pipe_test --singlefile --html
423 ./pipe_test.pl 1 0 < pipe_test.html
424 ./pipe_test.pl 2 1 < pipe_test.html
425 ./pipe_test.pl 3 0 < pipe_test.html
426 $(ROBODOC) --src pipe_test.dat --doc pipe_test --singlefile --latex
427 @ if [ -x "`which latex`" ] ; then \
428 latex pipe_test.tex > /dev/null 2>&1 ; rm -f pipe_test/dvi ; \
430 echo "latex missing, can not perform test"; \
432 ./pipe_test.pl 2 0 < pipe_test.tex
433 ./pipe_test.pl 1 1 < pipe_test.tex
438 master_index_test : Doc2/masterindex.html
441 Doc2/masterindex.html : Scr2/master_index_test.dat
442 $(ROBODOC) --src Scr2 --doc Doc2 --html --multidoc --index --internal
449 RoboHeaders/rbh_test1.c : RoboHeaders/rbh_test1.dat
450 cp RoboHeaders/rbh_test1.dat RoboHeaders/rbh_test1.c
452 robohdrs_test.hdrs : RoboHeaders/rbh_test1.c
453 cd RoboHeaders; ../$(ROBOHDRS) -p HDRS rbh_test1.c ; cd ..
454 touch robohdrs_test.hdrs
461 robohdrs_test.doc : robohdrs_test.hdrs
463 $(ROBODOC) --src RoboHeaders --doc Doc1 --html --multidoc --index
465 robohdrs_test : robohdrs_test.doc
469 doc_dir_filter_test.doc : doc_dir_filter_test.rc
470 $(ROBODOC) --rc doc_dir_filter_test.rc
471 $(ROBODOC) --rc doc_dir_filter_test.rc
473 doc_dir_filter_test : doc_dir_filter_test.doc
484 $(ROBODOC) --src FileFilterSrc_2 --doc Doc3 --html --multidoc --index --rc filter_test_2.rc
486 filter_test_2 : filter_test_2.doc
494 $(ROBODOC) --src FileFilterSrc --doc Doc1 --html --multidoc --index --rc filter_test_1.rc
496 filter_test_1 : filter_test_1.doc
505 $(ROBODOC) --src SortSource --doc Doc1 --html --multidoc --index --toc
507 sort_test : sort_test.doc
515 $(ROBODOC) --src SortSource --doc Doc1 --html --multidoc --index --toc --nosort
517 nosort_test : nosort_test.doc
521 nosource_test : nosource_test.html
522 ./$(@F).pl < nosource_test.html
524 nosource_test.html : nosource_test.dat
525 $(ROBODOC) --src nosource_test.dat --doc nosource_test --singlefile --nosource --html
527 ignore_test : ignore_test.html
528 ./$(@F).pl < ignore_test.html
530 ignore_test.html : ignore_test.dat
531 $(ROBODOC) --src ignore_test.dat --doc ignore_test --singlefile --html --rc ignore_test.rc
536 rm -rf Doc1/ToBeAccepted