02coverage.t 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. # $Id$
  2. use strict;
  3. use File::Spec;
  4. BEGIN { if (defined($ENV{'top_srcdir'})) {unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');} }
  5. require 't/test_utils.pl';
  6. my @test_cases = (
  7. ['commands','@@ @TeX{} @
  8. @"e @^{@dotless{i}} @~{a} @ringaccent a
  9. @clicksequence{File @click{} Open}@.
  10. @email{a, b} @code{code --- -- \'\' ``}
  11. --- -- \'\' ``. @sc{small caps}.
  12. @cindex index entry ``in text\'\' @LaTeX{}
  13. @majorheading majorheading @b{in b}
  14. '],
  15. ['lettered_accent_and_spaces',
  16. '@ringaccent a
  17. '],
  18. ['accent_and_dash',
  19. '@^{a--}'],
  20. ['math',
  21. 'Simple math
  22. @math{--{x^i}\over{\tan y}}
  23. Math with @@-command
  24. @math{@code{math code} a < b \sum@sub{i} q@sup{2}}
  25. Complex
  26. @math{ \underline{@code{math \hbox{ code }}} @\i \sum_{i}{\underline{f}}}
  27. @@\ outside of math
  28. @\
  29. The 3@sup{rd}is the I@sub{r}.
  30. '],
  31. ['empty_w',
  32. '@w{} @w{a b}.'
  33. ],
  34. ['hyphenation',
  35. '
  36. @hyphenation{some-where }
  37. '],
  38. ['block_commands','
  39. @group
  40. in group
  41. @end group
  42. @quotation warning
  43. in quotation
  44. @end quotation
  45. @float a float, b float
  46. In float
  47. @caption{in caption
  48. in caption}
  49. @end float
  50. '],
  51. ['raggedright','
  52. @raggedright
  53. in raggedright
  54. @end raggedright
  55. '],
  56. ['item_container','
  57. @itemize +
  58. @item i--tem +
  59. @end itemize
  60. @itemize @bullet
  61. @item
  62. b--ullet
  63. @end itemize
  64. @itemize
  65. @item no itemize argument
  66. @end itemize
  67. '],
  68. ['table','
  69. @table @asis
  70. @item table item
  71. @itemx table itemx
  72. In table
  73. @end table
  74. @vtable @samp@c samp
  75. @c after vtable
  76. @cindex index entry
  77. @item vtable item
  78. @c after item
  79. @kindex key
  80. @itemx itemx vtable @comment comment in itemx line
  81. @end vtable
  82. '],
  83. ['table_command_comment',
  84. '@table @code@c in comment
  85. @item item
  86. @end table'
  87. ],
  88. ['multitable','
  89. @multitable @columnfractions 0.6 0.4
  90. @headitem mu--ltitable headitem @tab another tab
  91. @item mu--ltitable item @tab multitable tab
  92. @c comment in multitable
  93. @item mu--ltitable item 2 @tab multitable tab 2
  94. @cindex index entry within multitable
  95. @item lone mu--ltitable item
  96. @end multitable
  97. @multitable {truc} {bidule}
  98. @item truc @tab bidule
  99. @end multitable
  100. '],
  101. ['preformatted','
  102. @example
  103. e--xample some
  104. text
  105. @end example
  106. @format
  107. @vtable @code
  108. @item item in table in format
  109. in table in format
  110. @end vtable
  111. @end format
  112. '],
  113. ['def','
  114. @deffn {c--ategory} d--effn_name a--rguments...
  115. d--effn
  116. @end deffn
  117. @deffn cate--gory de--ffn_name ar--guments @
  118. more args @* even more so
  119. def--fn
  120. @end deffn
  121. @deffn fset @var{i} a g
  122. @deffnx {cmde} truc {}
  123. @deffnx Command {log trap} {}
  124. @deffnx Command { log trap1} {}
  125. @deffnx Command {log trap2 } {}
  126. @deffnx cmde @b{id ule} truc
  127. @deffnx cmde2 @b{id @samp{i} ule} truc
  128. @deffnx{} machin
  129. @deffnx{} {bidule machin}
  130. @deffnx{truc} machin
  131. @deffnx {truc} followed by a comment
  132. @c comment
  133. @deffnx {truc} after a deff item
  134. @c comment
  135. @deffnx {truc} deffnx before end deffn
  136. Various deff lines
  137. @end deffn
  138. '],
  139. ['symbol_after_command',
  140. '@table @asis
  141. @item. dot
  142. @item, comma
  143. @item@@ @@
  144. @item@{ @{
  145. @item! exclam
  146. @item\'\' quotes
  147. @item: colon
  148. @end table
  149. @@. @{, @@@@ @?, @!: @@@{ @@\'\' @@:
  150. '],
  151. ['nested_block_commands',
  152. '@group
  153. In group
  154. @quotation
  155. in quotation
  156. @end quotation
  157. @end group
  158. @group
  159. @quotation
  160. in quotation
  161. @end quotation
  162. @end group
  163. @group
  164. In group
  165. @quotation
  166. in quotation
  167. @end quotation
  168. after quotation
  169. @end group
  170. @group
  171. In group sp b
  172. @quotation
  173. in quotation
  174. @end quotation
  175. @end group
  176. @group
  177. In group sp b a
  178. @quotation
  179. in quotation
  180. @end quotation
  181. @end group
  182. @group
  183. In group sp a
  184. @quotation
  185. in quotation
  186. @end quotation
  187. @end group
  188. @group
  189. @quotation
  190. in quotation sp b
  191. @end quotation
  192. @end group
  193. @group
  194. @quotation
  195. in quotation sp b a
  196. @end quotation
  197. @end group
  198. @group
  199. @quotation
  200. in quotation sp a
  201. @end quotation
  202. @end group
  203. @group
  204. @quotation
  205. in quotation
  206. @end quotation
  207. After quotation sp b
  208. @end group
  209. @group
  210. @quotation
  211. in quotation
  212. @end quotation
  213. After quotation sp a
  214. @end group
  215. @group
  216. @quotation
  217. in quotation
  218. @end quotation
  219. After quotation sp b a
  220. @end group
  221. '],
  222. ['cartouche',
  223. '@cartouche
  224. in cartouche.
  225. @end cartouche'],
  226. ['indentedblock',
  227. '@indentedblock
  228. indented block
  229. Text
  230. @end indentedblock
  231. '],
  232. ['comment_on_cartouche_line',
  233. '@cartouche @c comment
  234. in cartouche.
  235. @end cartouche
  236. '],
  237. ['comment_on_group_line',
  238. '@group @c comment
  239. in group.
  240. @end group
  241. '],
  242. ['insertcopying',
  243. '@copying
  244. License.
  245. @quotation
  246. You are not allowed.
  247. @end quotation
  248. @end copying
  249. License:
  250. @insertcopying
  251. '],
  252. ['flushleft_flushright',
  253. '
  254. @flushleft
  255. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccc
  256. ldskf dsflj
  257. lklsdlv l lll. Bbb.
  258. lhds
  259. @end flushleft
  260. @flushright
  261. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccc
  262. ldskf dsflj
  263. lklsdlv l lll. Bbb.
  264. lhds
  265. @end flushright
  266. '],
  267. ['quotation_author',
  268. '@quotation
  269. @author First Author
  270. quotation
  271. @author S@~econd author
  272. quotation continues.
  273. @end quotation
  274. '],
  275. ['flushleft_flushright_in_quotation',
  276. '
  277. @quotation
  278. @flushleft
  279. f l
  280. @end flushleft
  281. @flushright
  282. f r
  283. @end flushright
  284. @end quotation
  285. '],
  286. ['cartouche_in_quotation',
  287. '@quotation
  288. In quotation
  289. @cartouche
  290. In cartouche in quotation
  291. @end cartouche
  292. end quotation
  293. @end quotation
  294. '],
  295. ['cartouche_in_example',
  296. '@example
  297. In example
  298. @cartouche
  299. In cartouche in example
  300. @end cartouche
  301. end example
  302. @end example
  303. '],
  304. ['flushright_example_nested',
  305. '@example
  306. @flushright
  307. in --- flushright
  308. @end flushright
  309. @end example
  310. @flushright
  311. @example
  312. in --- example
  313. flush then example
  314. @end example
  315. @end flushright
  316. '],
  317. ['center',
  318. '
  319. @center in center @code{in code}
  320. '],
  321. ['titlefont_in_center',
  322. '
  323. @center @titlefont{A manual}
  324. '],
  325. ['exdent_and_formats',
  326. '@example
  327. Example Hoho. @TeX{} . @* @@.
  328. @exdent Other line
  329. not exdented
  330. @end example
  331. @example
  332. @exdent exdented and dash --- in example
  333. Not exdented
  334. @exdent exdented
  335. Not exdented
  336. @end example
  337. Para1.
  338. @quotation
  339. qsddsqkdsqkkmljsqjsqodmmdsqdsmqj dqs sdq sqd sdq dsq sdq sqd sqd sdq sdq
  340. qsd dsq sdq dsq dssdq sdq sdq sdq dsq sdq dsq dsq sdq dsq sdqsd q
  341. @end quotation
  342. Para2.
  343. Para3.
  344. Last para.
  345. @quotation
  346. quotation1
  347. quotation2
  348. @end quotation
  349. @quotation
  350. quotation para 1
  351. quotation para 2
  352. @end quotation
  353. @example
  354. Example Hoho.
  355. @example
  356. Nested Other line
  357. @exdent exdented nested other line
  358. @end example
  359. @end example
  360. @quotation
  361. @exdent exdented quotation line and dash --- in quotation
  362. @end quotation
  363. @quotation
  364. Not exdented followed by exdented
  365. @exdent exdented quotation line
  366. @end quotation
  367. @quotation
  368. @exdent exdented quotation line
  369. Followed by not exdented
  370. @end quotation
  371. @quotation
  372. @exdent exdented quotation line oidfjslsd aez a aze azaz aeae za eaz az
  373. @exdent azeaz az az az az
  374. @end quotation
  375. @quotation
  376. @exdent exdented quotation line oidfjslsd aez a aze azaz aeae za eaz az azeaz end line
  377. @exdent az az az az
  378. @end quotation
  379. @quotation
  380. quotation line oidfjslsd aez a aze azaz aeae za eaz az zelef aaa
  381. @exdent ezkfjklezf
  382. @end quotation
  383. @quotation
  384. @exdent very loooooooooooooooooooooooooooooooooong exdented quotation line oidfjslsd aez a aze azaz aeae za eaz az azeaz end line
  385. @exdent az az az az
  386. @end quotation
  387. '],
  388. ['exdent_and_commands',
  389. '@quotation
  390. quotation1
  391. @exdent in exdented protected eol @
  392. following
  393. @exdent in exdented a @@* @* and following
  394. after exdented
  395. @end quotation
  396. @example
  397. example
  398. @exdent in exdented protected eol @
  399. following
  400. @exdent in exdented a @@* @* and following
  401. after exdented
  402. @end example
  403. '],
  404. ['verbatiminclude',
  405. '
  406. @verbatiminclude incl-incl.txi
  407. '],
  408. ['punctuation_in_line_commands',
  409. '
  410. @node node! After punc
  411. @top top! After punc
  412. @table @asis
  413. @item item! After punc
  414. @end table
  415. @quotation quotation arg! After punc
  416. In quotation
  417. @exdent exdent quotation! After punc
  418. @end quotation
  419. @float float type! After punc, float label! After punc
  420. In float
  421. @shortcaption{shortcaption! After punc}
  422. @end float
  423. @float float type! After punc, label with caption
  424. In float with caption.
  425. @caption{caption! After punc}
  426. @end float
  427. @listoffloats float type! After punc
  428. @cindex index! After punc
  429. @heading heading! After punc
  430. @titlefont{titlefont! After punc}
  431. @center center! After punc
  432. @printindex cp
  433. @contents
  434. '],
  435. ['test_tie',
  436. 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@tie{}BBBBBBBBBBB
  437. '],
  438. ['test_today',
  439. '@today{}.', {}, {'TEST' => 1}],
  440. ['at_after_accent_command',
  441. '@ringaccent @@. @^@@.
  442. '],
  443. ['setfilename_in_paragraph',
  444. 'Some text
  445. @setfilename filename.info
  446. '],
  447. ['invalid_U',
  448. '@U @U{} @U{z} @U{abc} @U{9999999999999} @U{110000} @U{10FFFF}
  449. '],
  450. ['test_errormsg',
  451. 'Some text
  452. @errormsg{Text @~e @code{code}}
  453. '],
  454. ['unknown_accents',
  455. '@"X @"x @"Q @"Y
  456. @\'z @\'q @\'r
  457. @\'Z @\'Q @\'R
  458. @,{H} @,{h}
  459. @^z @^r @^t @^k
  460. @^Z @^R @^T @^K
  461. @`z @`m @`p
  462. @~Z @~s
  463. '],
  464. );
  465. my @test_tree = (
  466. ['arg_in_brace_no_arg_command',
  467. '@TeX{in tex}
  468. '],
  469. ['accents_errors',
  470. 'accent at end of line @ringaccent
  471. accent at end of line and spaces @ringaccent
  472. accent followed by @@ @ringaccent@.
  473. accent character with spaces @~ following.
  474. accent character at end of line @~
  475. accent character followed by @@ @~@.
  476. '],
  477. ['accent_no_closed',
  478. '@~{e'],
  479. ['accent_no_closed_newline',
  480. '@~{e
  481. '],
  482. ['accent_no_closed_paragraph',
  483. '@~{e
  484. other para.
  485. '],
  486. ['accent_no_closed_comment',
  487. '@~{e @c comment
  488. '],
  489. ['not_i_j_in_dotless',
  490. '@dotless a bc, @^{@dotless{q}}.'],
  491. ['indicateurl_end_lines',
  492. '@indicateurl{http://begin
  493. continue on other line}
  494. @indicateurl{http://begin2
  495. cut by blank line}
  496. '],
  497. ['spaces_after_braced_command',
  498. '@code {b}
  499. @samp
  500. {v}
  501. '],
  502. ['spaces_no_brace_after_braced_command',
  503. '@code b
  504. '],
  505. ['flushright_not_closed',
  506. '@flushright
  507. text flushed right
  508. '],
  509. ['group_not_closed',
  510. '@group
  511. text in group
  512. '],
  513. ['unknown_commands',
  514. '@unknwon
  515. @#
  516. '],
  517. ['symbol_after_block',
  518. '@html
  519. In html
  520. @end html. On the line.
  521. @html
  522. In html
  523. @end html@@ On the line.
  524. Verbatim:
  525. @verbatim
  526. In verbatim
  527. @end verbatim;
  528. @verbatim
  529. In verbatim
  530. @end verbatim@@
  531. Table:
  532. @table @emph
  533. @item a
  534. l--ine
  535. @end table+
  536. @table @emph
  537. @item a
  538. l--ine
  539. @end table@@
  540. Itemize:
  541. @itemize @bullet
  542. @item e--mph item
  543. @end itemize\'\'
  544. @itemize @bullet
  545. @item e--mph item
  546. @end itemize@@
  547. Multitable:
  548. @multitable @columnfractions 6 7
  549. @headitem mu--ltitable headitem @tab another tab
  550. @item mu--ltitable item @tab multitable tab
  551. @end multitable^
  552. @multitable @columnfractions 6 7
  553. @headitem mu--ltitable headitem @tab another tab
  554. @item mu--ltitable item @tab multitable tab
  555. @end multitable@{
  556. Flushleft:
  557. @flushleft
  558. flushleft
  559. @end flushleft!
  560. @flushleft
  561. flushleft
  562. @end flushleft@@
  563. Copying:
  564. @copying
  565. Copying
  566. @end copying*
  567. @copying
  568. Copying
  569. @end copying@@
  570. '],
  571. ['formats_titles',
  572. '@itemize
  573. before first itemize
  574. @item item
  575. @end itemize
  576. @enumerate
  577. before first enumerate
  578. @item enum
  579. @end enumerate
  580. @table @emph
  581. before first table
  582. @item tab
  583. @end table
  584. @vtable @asis
  585. before first vtable
  586. @item vtab
  587. @end vtable
  588. @multitable @columnfractions 0.5 0.5
  589. before first multitable
  590. @item item multit @tab tab multit
  591. @end multitable
  592. '],
  593. ['formats_only_titles',
  594. '@itemize
  595. before first itemize
  596. @end itemize
  597. @enumerate
  598. before first enumerate
  599. @end enumerate
  600. @table @emph
  601. before first table
  602. @end table
  603. @vtable @asis
  604. before first vtable
  605. @end vtable
  606. @multitable @columnfractions 0.5 0.5
  607. before first multitable
  608. @end multitable
  609. '],
  610. ['formats_only_title_comments',
  611. '@itemize
  612. @c comment itemize
  613. before first itemize
  614. @end itemize
  615. @enumerate @c comment on enumerate line
  616. @c comment enumerate
  617. before first enumerate
  618. @end enumerate
  619. @table @emph
  620. @c comment table
  621. before first table
  622. @end table
  623. @vtable @asis @c comment on vtable line
  624. before first vtable
  625. @end vtable
  626. @multitable @columnfractions 0.5 0.5
  627. @c comment multitable
  628. before first multitable
  629. @end multitable
  630. '],
  631. ['delcomment', undef, {'test_file' => 'delcomment.texi'}
  632. ],
  633. ['group_beginning_and_end_on_line',
  634. '@group within @end group
  635. '],
  636. );
  637. foreach my $test (@test_cases) {
  638. push @{$test->[2]->{'test_formats'}}, 'plaintext';
  639. push @{$test->[2]->{'test_formats'}}, 'html_text';
  640. push @{$test->[2]->{'test_formats'}}, 'xml';
  641. push @{$test->[2]->{'test_formats'}}, 'docbook';
  642. }
  643. our ($arg_test_case, $arg_generate, $arg_debug);
  644. run_all ('coverage', [@test_cases, @test_tree], $arg_test_case,
  645. $arg_generate, $arg_debug);