html_tests.t 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. use strict;
  2. use File::Spec;
  3. BEGIN { if (defined($ENV{'top_srcdir'})) {unshift @INC, File::Spec->catdir($ENV{'top_srcdir'}, 'tp');} }
  4. require 't/test_utils.pl';
  5. my @test_cases = (
  6. ['verbatim_in_multitable_in_example',
  7. '@example
  8. @multitable @columnfractions 0.5 0.5
  9. @item in item
  10. @tab in tab
  11. @item
  12. @verbatim
  13. in first column, verbatim
  14. @end verbatim
  15. @tab
  16. @verbatiminclude inc_file.texi
  17. @end multitable
  18. @end example
  19. '],
  20. ['commands_in_alt',
  21. '@image{f--ile,,,alt -- @b{in b}}
  22. @example
  23. @image{f--ile,,,alt -- @b{in b}}
  24. @end example
  25. '],
  26. ['image_link_prefix',
  27. '@image{image}', {},{'IMAGE_LINK_PREFIX' => '../img'}
  28. ],
  29. ['commands_in_abbr',
  30. '@abbr{A, @b{abbr} -- b}.
  31. @example
  32. @abbr{A, @b{abbr} -- b}.
  33. @end example
  34. '],
  35. ['raw_html',
  36. '@html
  37. <i>
  38. @end html
  39. '],
  40. ['xml_protected_in_verb',
  41. '@verbatim
  42. <a>
  43. @end verbatim
  44. @verb{. <i> .}.
  45. @verbatiminclude file_with_xml_chars.texi
  46. '],
  47. ['index_and_node_same_name',
  48. '@top top
  49. @node index node
  50. @cindex node
  51. @printindex cp
  52. '],
  53. ['documentdescription',
  54. '@documentdescription
  55. in @code{documentdescri---ption} --- @bullet{} @enddots{} @verb{:"verb:} @aa{} @^{@dotless{i}} @email{@code{some}body}
  56. @end documentdescription
  57. @top top
  58. '],
  59. ['index_below',
  60. '@top top
  61. @chapter chap
  62. @section sec
  63. @cindex entry
  64. @printindex cp
  65. ', {'test_split' => 'section'}, {'USE_NODES', 0}],
  66. ['simple_menu',
  67. '@menu
  68. * (ggg):: description
  69. @itemize
  70. @item idescr
  71. @end itemize
  72. @html
  73. in html
  74. @end html
  75. AAA
  76. CCC
  77. @itemize
  78. @item iaa
  79. @end itemize
  80. @html
  81. in html title
  82. @end html
  83. BBB
  84. @itemize
  85. @item ibb
  86. @end itemize
  87. * (manual)::
  88. comment
  89. * (after_comment):: description
  90. in description
  91. * (after_description)::
  92. @detailmenu
  93. * (detailggg):: detaildescription
  94. @itemize
  95. @item idetaildescr
  96. @end itemize
  97. @html
  98. detailin detailhtml
  99. @end html
  100. detailAAA
  101. detailCCC
  102. @itemize
  103. @item detailiaa
  104. @end itemize
  105. @html
  106. detailin html detailtitle
  107. @end html
  108. detailBBB
  109. @itemize
  110. @item detailibb
  111. @end itemize
  112. * (detailmanual)::
  113. detailcomment
  114. * (detailafter_comment):: detaildescription
  115. in detaildescription
  116. * (detailafter_description)::
  117. @end detailmenu
  118. @end menu
  119. ' ,{'SIMPLE_MENU' => 1, 'test_formats' => ['info']}
  120. ],
  121. ['character_number_leading_toc_stoc',
  122. '@top top
  123. @chapter 0
  124. @unnumbered _
  125. @section ?
  126. @contents
  127. @shortcontents
  128. '],
  129. ['shortcontents_no_top',
  130. '@chapter chap
  131. @chapter chap2
  132. @section sec
  133. @shortcontents
  134. '],
  135. ['test_xrefautomaticsectiontitle',
  136. '@node Top
  137. @top top
  138. @menu
  139. * chap::
  140. @end menu
  141. @node chap
  142. @chapter chapter
  143. @xrefautomaticsectiontitle on
  144. @xref{chap}.
  145. @xrefautomaticsectiontitle off
  146. @xref{chap}.
  147. ']
  148. ,['tex_expanded_in_copying',
  149. '@copying
  150. @tex
  151. aa
  152. @end tex
  153. @end copying
  154. ', {'expanded_formats' => ['tex']},
  155. {'expanded_formats' => ['tex']}
  156. ],
  157. ['titles',
  158. '@setfilename html-title.info
  159. @settitle @@title @sc{html} @code{test}
  160. @node Top
  161. @top Top of @@title @sc{html} @code{test}
  162. Top.
  163. Second paragraph.
  164. '],
  165. ['html_in_copying',
  166. '
  167. @copying
  168. Copying
  169. @html
  170. in <b>html</b> in copying ``
  171. @end html
  172. @end copying
  173. @node Top
  174. @top top
  175. '],
  176. ['empty_lines_at_beginning_no_setfilename',
  177. undef, {'test_file' => 'empty_lines_at_beginning_no_setfilename.texi'}
  178. ],
  179. ['empty_lines_at_beginning_no_setfilename_no_element',
  180. undef, {'test_file' => 'empty_lines_at_beginning_no_setfilename_no_element.texi'}
  181. ],
  182. ['check_htmlxref',
  183. '
  184. @node Top, (../there/no_existing_no_manual_direction), first, (dir)
  185. @top top
  186. @ref{a, b, c, no_existing_no_manual.info}
  187. @ref{a, b, c, no_existing_no_manual.info}
  188. @menu
  189. * first::
  190. * (other_no_existing_no_manual)::
  191. @end menu
  192. @node first, (no_existing_no_manual.info)
  193. ', {}, {'CHECK_HTMLXREF' => 1}],
  194. );
  195. my @test_cases_text = (
  196. ['commands_in_email',
  197. '@email{endots @enddots{} @code{in code}}'
  198. ],
  199. ['no_use_iso',
  200. 'AA @^e --- -- \'` \'\' ``', {}, {'USE_ISO' => 0}],
  201. ['utf8_no_use_entity',
  202. '@documentencoding utf-8
  203. AA @^e --- -- \'` \'\' ``', {}, {'ENABLE_ENCODING_USE_ENTITY' => 0}],
  204. ['utf8_no_use_entity_enable_encoding',
  205. '@documentencoding utf-8
  206. AA @^e --- -- \'` \'\' ``', {}, {'ENABLE_ENCODING' => 1,
  207. 'ENABLE_ENCODING_USE_ENTITY' => 0}],
  208. ['utf8_enable_encoding',
  209. '@documentencoding utf-8
  210. AA @^e --- -- \'` \'\' ``', {}, {'ENABLE_ENCODING' => 1}],
  211. ['utf8_no_use_entity_no_use_iso',
  212. '@documentencoding utf-8
  213. AA @^e --- -- \'` \'\' ``', {}, {'ENABLE_ENCODING_USE_ENTITY' => 0,
  214. 'USE_ISO' => 0}],
  215. ['utf8_no_use_entity_enable_encoding_no_use_iso',
  216. '@documentencoding utf-8
  217. AA @^e --- -- \'` \'\' ``', {}, {'ENABLE_ENCODING' => 1, 'USE_ISO' => 0,
  218. 'ENABLE_ENCODING_USE_ENTITY' => 0}],
  219. ['utf8_enable_encoding_no_use_iso', # this one leads to transiliterated text as
  220. # ENABLE_ENCODING_USE_ENTITY is set
  221. # so even ENABLE_ENCODING transformation
  222. # to utf-8 characters is not done
  223. '@documentencoding utf-8
  224. AA @^e --- -- \'` \'\' ``', {}, {'ENABLE_ENCODING' => 1,
  225. 'USE_ISO' => 0}],
  226. ['ref_in_preformatted',
  227. '@node Top
  228. @menu
  229. * nnn the node name::
  230. @end menu
  231. @example
  232. Now @ref{nnn the
  233. node name}
  234. @end example
  235. @node nnn the node name
  236. '],
  237. );
  238. # problem is that the result is code with accented letters,
  239. # it may not come out right. So this test is left unused for now.
  240. # Also could be in converters_tests
  241. my @todo = (
  242. ['enable_encoding',
  243. '@documentencoding utf-8
  244. @u{--a}
  245. @^{--a}
  246. @AA{} @~{@dotless{i}} @dotless{i}.
  247. @equiv{}
  248. @sc{@AA{} @~{@dotless{i}} @dotless{i}}.
  249. ',{}, {'ENABLE_ENCODING' => 1}]
  250. );
  251. # test that the node name that goes in the redirection file is reproducible.
  252. my @file_tests = (
  253. ['redirection_same_labels',
  254. '@setfilename redirection_same_labels.info
  255. @node Top
  256. @top the top
  257. @menu
  258. @c * @"i::
  259. @c * @~{@dotless{i}}::
  260. @c * @^i::
  261. * umlaut::
  262. * circumflex::
  263. @end menu
  264. @node umlaut
  265. @chapter umlaut
  266. @menu
  267. * @"i::
  268. * @~{@dotless{i}}::
  269. @end menu
  270. @node @"i
  271. @node @~{@dotless{i}}
  272. @node circumflex
  273. @chapter circumflex
  274. @menu
  275. * @^i::
  276. @end menu
  277. @node @^i
  278. ', {'test_split' => 'section'}, {'SPLIT' => 'chapter'}],
  279. );
  280. foreach my $test (@test_cases) {
  281. push @{$test->[2]->{'test_formats'}}, 'html';
  282. }
  283. foreach my $test (@test_cases_text) {
  284. push @{$test->[2]->{'test_formats'}}, 'html_text';
  285. }
  286. foreach my $test (@file_tests) {
  287. push @{$test->[2]->{'test_formats'}}, 'file_html';
  288. }
  289. our ($arg_test_case, $arg_generate, $arg_debug);
  290. run_all ('html_tests', [@test_cases, @test_cases_text, @file_tests], $arg_test_case,
  291. $arg_generate, $arg_debug);
  292. 1;