1 #LyX 2.2 created this file. For more info see http://www.lyx.org/
5 \save_transient_properties true
6 \origin /systemlyxdir/doc/
8 \options BCOR8mm,captions=tableheading
9 \use_default_options false
13 \maintain_unincluded_children false
15 \language_package default
18 \font_roman "lmodern" "default"
19 \font_sans "lmss" "default"
20 \font_typewriter "lmtt" "default"
21 \font_math "auto" "auto"
22 \font_default_family default
23 \use_non_tex_fonts false
26 \font_sf_scale 100 100
27 \font_tt_scale 100 100
29 \default_output_format pdf2
31 \bibtex_command default
32 \index_command default
36 \pdf_title "LyX's Development manual"
37 \pdf_author "LyX Team"
38 \pdf_subject "LyX's development documentation"
39 \pdf_keywords "LyX, Documentation, Development"
41 \pdf_bookmarksnumbered true
42 \pdf_bookmarksopen true
43 \pdf_bookmarksopenlevel 1
48 \pdf_pdfusetitle false
49 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
52 \use_package amsmath 1
53 \use_package amssymb 1
56 \use_package mathdots 1
57 \use_package mathtools 0
59 \use_package stackrel 0
60 \use_package stmaryrd 0
61 \use_package undertilde 0
63 \cite_engine_type default
67 \paperorientation portrait
71 \notefontcolor #0000ff
78 \paragraph_separation indent
79 \paragraph_indentation default
80 \quotes_language english
83 \paperpagestyle headings
84 \tracking_changes false
94 Developing \SpecialChar LyX
98 \begin_layout Subtitle
103 by the \SpecialChar LyX
108 \begin_layout Plain Layout
110 If you have comments or error corrections, please send them to the \SpecialChar LyX
113 \begin_inset Flex Code
116 \begin_layout Plain Layout
118 <lyx-docs@lists.lyx.org>
131 \begin_layout Standard
132 \begin_inset CommandInset toc
133 LatexCommand tableofcontents
140 \begin_layout Section
144 \begin_layout Standard
145 This manual documents some aspects of \SpecialChar LyX
147 It is currently rather incomplete, but will hopefully be extended in the
149 Meanwhile, additional information can be found in the
150 \begin_inset Flex Code
153 \begin_layout Plain Layout
159 subfolder of the \SpecialChar LyX
160 source code distribution.
161 This document is not translated, since the development language of \SpecialChar LyX
164 If you just want to use \SpecialChar LyX
165 , then you don't need to read this manual.
166 However, if you want to learn more about how \SpecialChar LyX
167 is developed, or even want
168 to participate in \SpecialChar LyX
169 development, you may find some interesting information
173 \begin_layout Section
177 \begin_layout Standard
179 uses several custom file formats for configuration files and documents.
180 This chapter contains some background concerning these file formats.
181 Several file formats are also described in detail in the regular user documenta
185 \begin_layout Subsection
189 \begin_layout Subsection
190 When is an update of the .lyx file format number needed?
191 \begin_inset CommandInset label
193 name "sec:When-is-an"
200 \begin_layout Standard
201 When you are working on a new feature you may ask yourself whether it needs
202 an update of the .lyx file format number.
203 Whether an update is needed or not is not always obvious.
208 Whenever there is the danger that a previous version of LyX cannot open
209 a file using the new feature, a file format update is needed.
212 \begin_layout Standard
213 The file format change allows lyx2lyx rules to implement backwards compatibility.
214 Below you can find a list of reasons for file format updates with explanations:
217 \begin_layout Description
226 setting Whenever you introduce a new setting that is stored in the document
227 header, a file format update is needed.
230 \begin_layout Description
239 setting If a certain setting becomes obsolete and gets removed, a file format
243 \begin_layout Description
269 \begin_inset space \thinspace{}
276 \begin_layout Description
277 \paragraph_spacing single
290 package The reason for this is that there is no true ERT inset for math
291 formulas: Each command is parsed, and if a user happens to define a local
292 command with the same name as a command that triggers an automatic load
293 of a package, they need to be able to switch off the automatic loading
295 This switch is stored by the
296 \begin_inset Flex Code
299 \begin_layout Plain Layout
308 \begin_layout Description
313 language that is stored in
314 \begin_inset Flex Code
317 \begin_layout Plain Layout
327 \begin_inset Note Note
330 \begin_layout Plain Layout
331 This requirement is under discussion.
340 \begin_layout Description
345 inset Of course a new inset requires a file format update.
348 \begin_layout Description
353 style If a new style or inset layout is added to any layout file or module
354 shipped with \SpecialChar LyX
355 , then a new file format is needed in the master (development)
357 It is possible to backport new styles to the stable version without a file
360 \begin_inset CommandInset ref
362 reference "subsec:Backporting-new-styles"
366 for more information.
369 \begin_layout Description
374 style If a style or inset layout is removed in any layout file or module
375 shipped with \SpecialChar LyX
376 , a new file format is required.
379 \begin_layout Standard
384 layouts and modules do
388 require a file format update (changed 03/16, see
389 \begin_inset CommandInset ref
391 reference "subsec:New-layouts"
399 \begin_layout Standard
400 If you are still unsure, please ask on the development list.
403 \begin_layout Subsection
404 \begin_inset CommandInset label
406 name "subsec:update_lyx_files"
410 How to update the file format number of .lyx files
413 \begin_layout Standard
414 Once you come to the conclusion that a file format update is needed, you
415 should use the following procedure to perform the update:
418 \begin_layout Enumerate
419 Implement and test the new feature, including the reading and writing of
421 Note that any file produced at this stage does not use a valid format,
422 so do not use this version of \SpecialChar LyX
423 for working on any important documents.
426 \begin_layout Enumerate
427 \begin_inset CommandInset label
429 name "enu:Describe_format"
433 Describe the new format in
434 \begin_inset Flex Code
437 \begin_layout Plain Layout
446 \begin_layout Enumerate
447 Update the \SpecialChar LyX
448 file format number in
449 \begin_inset Flex Code
452 \begin_layout Plain Layout
461 \begin_layout Enumerate
462 \begin_inset CommandInset label
464 name "enu:Add-an-entry"
468 Add an entry to both format lists (for conversion and reversion) in
469 \begin_inset Newline newline
473 \begin_inset Flex Code
476 \begin_layout Plain Layout
477 lib/lyx2lyx/lyx_2_3.py
483 Add a conversion routine if needed (e.
484 \begin_inset space \thinspace{}
487 g., a new header setting always needs a conversion that adds the new setting,
488 but a new document language does not need one).
489 Add a reversion routine if needed.
491 \begin_inset Newline newline
494 While the conversion routine is required to produce a document that is equivalen
495 t to the old version, the requirements of the reversion are not that strict.
496 If possible, try to produce a proper reversion, using ERT if needed, but
497 for some features this might be too complicated.
498 In this case, the minimum requirement of the reversion routine is that
499 it produces a valid document which can be read by an older \SpecialChar LyX
501 If absolutely needed, even data loss is allowed for the reversion.
502 (In that case, you might want to add a LyX comment that indicates what
503 you have had to do, so the user is at least warned).
506 \begin_layout Enumerate
507 Since tex2lyx has several implicit file format dependencies caused by sharing
508 code with \SpecialChar LyX
509 , updating the file format of .lyx files produced by tex2lyx at
510 the same time as updating the main .lyx file format is strongly recommended.
511 Therefore, a compiler warning will be issued if the \SpecialChar LyX
512 and tex2lyx .lyx file
513 format numbers differ.
514 In many cases the tex2lyx update requires only the first and last item
519 \begin_layout Enumerate
520 Update the tex2lyx file format number in
521 \begin_inset Flex Code
524 \begin_layout Plain Layout
533 \begin_layout Enumerate
534 If the lyx2lyx conversion from the old to the new format is empty, or if
535 tex2lyx does not yet output the changed feature, you do not need any further
537 Otherwise, search for the changed feature in tex2lyx, and adjust the output
538 according to the lyx2lyx changes.
541 \begin_layout Enumerate
542 Update the tex2lyx test references as described in
543 \begin_inset CommandInset ref
544 LatexCommand formatted
545 reference "sec:Updating-test-references"
553 \begin_layout Enumerate
554 If you did not implement full tex2lyx support for the new feature, add a
556 \begin_inset Flex Code
559 \begin_layout Plain Layout
565 describing the missing bits.
566 Note that it is perfectly fine if you do not add full tex2lyx support for
567 a new feature: The updating recommendation above is only issued for the
568 syntax of the produced .lyx file.
569 It is no problem if some features supported by \SpecialChar LyX
570 are still output as ERT
572 The problems in the past that resulted in the update recommendation were
573 related to mixed version syntax, not ERT.
576 \begin_layout Enumerate
577 It would be nice if you could create a .lyx test file which contains instances
578 of all changed or added features.
579 This could then be used to test lyx2lyx and tex2lyx.
580 Unfortunately, it has not yet been decided how to collect such examples,
581 so please ask on the development list if you want to create one.
584 \begin_layout Enumerate
585 \begin_inset CommandInset label
587 name "enu:updatefiles"
591 Test your lyx2lyx code by updating LyX's .lyx documentation files to the
593 The developer who makes the change knows best what changes to expect when
594 inspecting the resulting diff.
595 Because of this, you might be able to catch a bug in the lyx2lyx code that
596 updates the format just by taking a quick scan through the large diff that
598 \begin_inset Note Note
601 \begin_layout Plain Layout
602 Another advantage is that if later we suspect a bug in lyx2lyx we can easily
603 see which layout update made an unexpected change by looking at the git
604 log of a .lyx file that suffers the problem.
609 To do this, first make sure that there are no changes to the git repository
610 that you will not want to commit (this is needed because it will be convenient
611 to commit with the command
612 \begin_inset Flex Code
615 \begin_layout Plain Layout
622 Then run the following command in the root folder of the source:
623 \begin_inset Flex Code
626 \begin_layout Plain Layout
627 python development/tools/updatedocs.py
633 Look at the resulting changes using the command
634 \begin_inset Flex Code
637 \begin_layout Plain Layout
644 If anything looks surprising, please investigate.
645 Keep in mind that the case of
646 \begin_inset Flex Code
649 \begin_layout Plain Layout
655 is special, because it is first generated with
656 \begin_inset Flex Code
659 \begin_layout Plain Layout
665 before being converted to the latest format.
666 \begin_inset Newline newline
670 \begin_inset Note Greyedout
673 \begin_layout Plain Layout
678 Only commit file format changes in the doc files if these files are using
679 the new feature of the new file format.
685 \begin_inset CommandInset ref
687 reference "enu:The-fileformat-of"
691 of the documentation policies described in sec.
696 \begin_inset CommandInset ref
698 reference "sec:Documentation-policies"
710 \begin_layout Enumerate
711 Finally, commit using
712 \begin_inset Flex Code
715 \begin_layout Plain Layout
724 \begin_layout Subsection
725 Updating the file format number of layout files
728 \begin_layout Standard
729 The procedure for updating the layout files is similar to that in step
730 \begin_inset CommandInset ref
732 reference "enu:updatefiles"
737 \begin_inset CommandInset ref
739 reference "subsec:update_lyx_files"
745 \begin_inset Flex Code
748 \begin_layout Plain Layout
749 python development/tools/updatelayouts.py
755 \begin_inset Flex Code
758 \begin_layout Plain Layout
767 \begin_layout Standard
768 Note that we do not automatically any local layout used in the
769 \begin_inset Flex Code
772 \begin_layout Plain Layout
778 files shipped with \SpecialChar LyX
779 because users would then not be able to export to older
781 For example, if a 2.2.0 user exported a template to 2.1.x format and tried
782 to open the file in \SpecialChar LyX
783 2.1.x, there would be an error because the file would
784 contain a local layout whose format is too new.
785 The root reason for this is that we do not support converting layouts to
786 older layout formats, as we do for the
787 \begin_inset Flex Code
790 \begin_layout Plain Layout
799 \begin_layout Subsection
800 Updating the file format number of bind/ui files
803 \begin_layout Standard
804 A change to the functionality of existing LFUNs can require a conversion
806 \begin_inset Flex Code
809 \begin_layout Plain Layout
816 \begin_inset Flex Code
819 \begin_layout Plain Layout
825 files, and therefore an increment of the LFUN format, as well as a conversion
827 \begin_inset Flex Code
830 \begin_layout Plain Layout
837 The latter cannot be done automatically and also requires an update of
841 \begin_inset space \space{}
844 of someone who might have made a set of \SpecialChar LyX
845 teaching manuals for use in their
850 \begin_layout Plain Layout
851 \begin_inset Flex URL
854 \begin_layout Plain Layout
856 http://www.lyx.org/trac/ticket/9794
869 \begin_layout Standard
870 To update the LFUN format:
873 \begin_layout Enumerate
874 Increment the LFUN file format number in
875 \begin_inset Flex Code
878 \begin_layout Plain Layout
887 \begin_layout Enumerate
888 Implement the LFUN conversion in
889 \begin_inset Flex Code
892 \begin_layout Plain Layout
893 lib/scripts/prefs2prefs_lfuns.py
901 \begin_layout Enumerate
903 \begin_inset CommandInset ref
905 reference "enu:updatefiles"
910 \begin_inset CommandInset ref
912 reference "subsec:update_lyx_files"
917 \begin_inset Flex Code
920 \begin_layout Plain Layout
926 command, use this command:
927 \begin_inset Flex Code
930 \begin_layout Plain Layout
931 bash development/tools/updatelfuns.sh
938 \begin_inset Note Note
941 \begin_layout Plain Layout
942 This file should really be converted to python.
950 \begin_layout Enumerate
951 Update Info insets in
952 \begin_inset Flex Code
955 \begin_layout Plain Layout
962 To do so, increment the \SpecialChar LyX
963 format and proceed as in
964 \begin_inset CommandInset ref
966 reference "subsec:update_lyx_files"
971 \begin_inset CommandInset ref
973 reference "enu:Describe_format"
978 \begin_inset CommandInset ref
980 reference "enu:updatefiles"
985 In the lyx2lyx implementation (step
986 \begin_inset CommandInset ref
988 reference "enu:Add-an-entry"
992 ), implement a conversion similar to the one in
993 \begin_inset Flex Code
996 \begin_layout Plain Layout
1002 above, as well as a corresponding reversion; for this one can use
1003 \begin_inset Flex Code
1006 \begin_layout Plain Layout
1013 \begin_inset Flex Code
1016 \begin_layout Plain Layout
1017 lib/lyx2lyx/lyx2lyx_tools.py
1026 \begin_layout Subsection
1027 Backporting new styles to the stable version
1028 \begin_inset CommandInset label
1030 name "subsec:Backporting-new-styles"
1037 \begin_layout Standard
1038 Starting with the stable \SpecialChar LyX
1039 2.1 branch, there is a mechanism in place to backport
1040 new styles to the stable version without the need to update the file format.
1041 The basic idea is that the new style definition is automatically copied
1042 to the document preamble so that it can even be used by older minor versions
1043 that did not yet include the style.
1044 To backport a new style to the stable version, the following steps are
1048 \begin_layout Enumerate
1050 \begin_inset Flex Code
1053 \begin_layout Plain Layout
1059 to the style definition in the development version.
1062 \begin_layout Enumerate
1063 Copy the style definition to the stable version, but use
1064 \begin_inset Flex Code
1067 \begin_layout Plain Layout
1074 If needed adjust the format to the one used by the stable version (see
1075 the customization manual for details of the layout file format).
1078 \begin_layout Enumerate
1079 For each update of the style in a later stable version, increase the argument
1081 \begin_inset Flex Code
1084 \begin_layout Plain Layout
1091 (In the stable version, the development version should not be touched.)
1094 \begin_layout Standard
1095 For details about the
1096 \begin_inset Flex Code
1099 \begin_layout Plain Layout
1105 flag see the customization manual.
1107 \begin_inset Flex Code
1110 \begin_layout Plain Layout
1116 support is needed for backported styles: Since the style of the development
1117 version has an infinite version number, it will always be used.
1118 Furthermore, since its version number is less than one, the style will
1119 not be written anymore to the document header for files saved by the new
1123 \begin_layout Section
1124 New layouts and modules
1127 \begin_layout Subsection
1128 \begin_inset CommandInset label
1130 name "subsec:New-layouts"
1137 \begin_layout Standard
1138 Adding a new layout file to the \SpecialChar LyX
1140 \begin_inset Quotes eld
1143 officially supported
1144 \begin_inset Quotes erd
1148 You should therefore think carefully about whether you really want to do
1149 this and discuss it on lyx-devel, since you will need to be prepared to
1150 update and fix the layout if necessary.
1151 If the layout is experimental or for a rarely used document class, then
1152 it may be better to add it to the relevant portion of the \SpecialChar LyX
1156 \begin_inset CommandInset href
1158 target "https://wiki.lyx.org/Layouts/Layouts"
1165 \begin_layout Standard
1166 In older versions of this document, it was stated that new layout files
1167 require a file format change.
1168 After some discussion, it was decided that this is not needed.
1172 \begin_layout Plain Layout
1174 \begin_inset CommandInset href
1176 name "the thread “Proposal for a guide on updating layouts”"
1177 target "http://permalink.gmane.org/gmane.editors.lyx.devel/161202"
1190 For reference, here are the arguments on each side
1194 \begin_layout Description
1196 \begin_inset Quotes eld
1199 New layout files are a file format change
1200 \begin_inset Quotes erd
1206 \begin_layout Itemize
1207 All documents produced by 2.2.
1208 \begin_inset Formula $x$
1211 can always be edited and exported even if
1212 \begin_inset Formula $x$
1216 This is important for people using different machines, or exchanging work
1220 \begin_layout Description
1222 \begin_inset Quotes eld
1225 New layout files are not a file format change
1226 \begin_inset Quotes erd
1232 \begin_layout Itemize
1233 No new LaTeX classes can be supported in a stable version, and stable versions
1234 have a typical lifetime of 2–3 years.
1237 \begin_layout Itemize
1238 We have the same situation already with custom layout files: If a document
1239 using a custom layout file is moved between machines or people, then the
1240 layout file needs to be exchanged as well.
1241 If that is not done, then we have a fallback implemented so that such documents
1242 can still be edited, but not exported, and the user gets a warning.
1246 \begin_layout Itemize
1247 The lyx2lyx script cannot do anything useful in such a case.
1251 \begin_layout Standard
1252 If you have decided that you are going to add a new layout file to \SpecialChar LyX
1254 then, you should do the following:
1257 \begin_layout Enumerate
1258 Put your new layout file in
1259 \begin_inset Flex Code
1262 \begin_layout Plain Layout
1269 \begin_inset Flex Code
1272 \begin_layout Plain Layout
1273 git add lib/layouts/newlayout.layout
1278 ) so that it will be committed.
1281 \begin_layout Enumerate
1283 \begin_inset Flex Code
1286 \begin_layout Plain Layout
1292 , so that the new layout actually gets installed.
1295 \begin_layout Enumerate
1297 \begin_inset Flex Code
1300 \begin_layout Plain Layout
1301 lib/doc/LaTeXConfig.lyx
1306 containing in particular a line like
1314 \begin_layout Standard
1315 where [InsetInfo] is obtained by entering in the minibuffer (Alt+X)
1316 \begin_inset Flex Code
1319 \begin_layout Plain Layout
1320 info-insert textclass <name>
1326 This inset will automatically display a boxed
1327 \begin_inset Quotes eld
1331 \begin_inset Quotes erd
1335 \begin_inset Quotes eld
1339 \begin_inset Quotes erd
1342 depending on the availability of the package.
1346 \begin_layout Enumerate
1347 A template or example is strongly encouraged (but not necessarily required).
1348 It is also possible to provide both.
1350 \begin_inset Flex Code
1353 \begin_layout Plain Layout
1360 \begin_inset Flex Code
1363 \begin_layout Plain Layout
1372 \begin_layout Enumerate
1373 Reconfigure \SpecialChar LyX
1377 \begin_layout Enumerate
1378 Ensure the autotests for the new layout pass (see
1379 \begin_inset CommandInset ref
1381 reference "par:when-to-run-an-export-test"
1388 \begin_layout Subsection
1392 \begin_layout Standard
1393 Adding a new module is very similar to adding a new layout.
1394 Therefore, the previous section applies to new modules as well, with two
1398 \begin_layout Enumerate
1399 You only need to add an entry to
1400 \begin_inset Flex Code
1403 \begin_layout Plain Layout
1404 lib/doc/LaTeXConfig.lyx
1409 if the module requires a LaTeX package.
1410 In that case, the command for entering the InsetInfo is:
1411 \begin_inset Flex Code
1414 \begin_layout Plain Layout
1415 \paragraph_spacing single
1416 info-insert package <name>
1424 \begin_layout Enumerate
1425 Modules do not need a template, only an example, which is strongly encouraged
1426 but not necessarily required.
1429 \begin_layout Subsection
1430 Layouts for document classes with incompatible versions
1433 \begin_layout Standard
1434 \begin_inset Note Greyedout
1437 \begin_layout Description
1438 Note: This section is currently only a proposal under discussion.
1439 Please correct/amend as suited.
1440 Remove this note once a consensus is found.
1443 \begin_layout Plain Layout
1445 \begin_inset Quotes eld
1448 Proposal for a guide on updating layouts
1449 \begin_inset Quotes erd
1452 for details and background
1455 \begin_layout Plain Layout
1456 http://permalink.gmane.org/gmane.editors.lyx.devel/161126
1464 \begin_layout Standard
1465 Every now and then, there are changes to LaTeX document classes that break
1466 backwards compatibility.
1470 \begin_layout Plain Layout
1471 Uwe has suggested we implement automatic detection of changes in class files.
1472 This could be done by running a script every month that checks if a document
1473 class was changed at CTAN and at the homepages of the scientific journals.
1474 If it reports a change, we can check if our template and layout file are
1475 still usable with the changed document class.
1476 (This is different from the autotests insofar, as this would also catch
1477 changes that do not result in compilation errors.)
1482 Reasons can be a new name for the
1483 \begin_inset Flex Code
1486 \begin_layout Plain Layout
1492 file, removed \SpecialChar LaTeX
1494 How should this best be handled in \SpecialChar LyX
1498 \begin_layout Standard
1499 The idea is to support the new version with a new \SpecialChar LyX
1503 \begin_layout Itemize
1504 Existing documents can still be opened in \SpecialChar LyX
1505 and will continue to work on
1506 systems where the old version is still installed.
1510 \begin_layout Itemize
1511 With differently named
1512 \begin_inset Flex Code
1515 \begin_layout Plain Layout
1521 files, \SpecialChar LyX
1522 can check for the availability of the particular version and reflect
1524 Different document class versions with the same file name are currently
1525 (2.2.x) not detected by the configuration script.
1526 This is planned for 2.3.
1530 \begin_layout Plain Layout
1531 https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg192467.html
1534 \begin_layout Plain Layout
1535 However, what we really need is version detection for the configuration,
1536 so that the user can be warned if the required class file has the wrong
1538 (If the class file keeps the name over the version change, only one of
1539 the two layout files generates compilable documents.)
1542 \begin_layout Plain Layout
1543 This point was also made here: http://permalink.gmane.org/gmane.editors.lyx.devel/143
1552 \begin_layout Itemize
1553 The new layout can be added both to the master and the stable branches,
1554 in accord with the policy discussed in
1555 \begin_inset CommandInset ref
1556 LatexCommand formatted
1557 reference "subsec:New-layouts"
1562 No lyx2lyx conversion is then required when a new major version is released.
1565 \begin_layout Standard
1566 The user can move an existing document to the new version simply by selecting
1567 a new document class.
1568 This step is well supported by \SpecialChar LyX
1569 , with established methods for handling
1570 unsupported styles and other changes.
1571 This way, no lyx2lyx code is required.
1574 \begin_layout Standard
1575 The steps to support a new version of an existing document class are thus:
1578 \begin_layout Itemize
1579 Create a new layout file including the upstream version in the name (avoid
1580 special characters like spaces and dots), e.g.
1582 \begin_inset Flex Code
1585 \begin_layout Plain Layout
1586 acmsiggraph-v0-92.layout
1594 \begin_layout Itemize
1595 Include the name of the
1596 \begin_inset Flex Code
1599 \begin_layout Plain Layout
1605 file as an optional argument in the
1606 \begin_inset Flex Code
1609 \begin_layout Plain Layout
1617 line and include the version number in the GUI name:
1618 \begin_inset Newline newline
1622 \begin_inset Flex Code
1625 \begin_layout Plain Layout
1628 DeclareLaTeXClass[acmsiggraph]{ACM SIGGGRAPH (v.
1629 \begin_inset space ~
1640 \begin_layout Itemize
1641 Update the GUI name in the old layout file (whose name should not be changed),
1643 \begin_inset Newline newline
1647 \begin_inset Flex Code
1650 \begin_layout Plain Layout
1653 DeclareLaTeXClass{ACM SIGGRAPH (<= v.
1654 \begin_inset space ~
1665 \begin_layout Itemize
1666 To avoid duplicate definitions, the new layout can
1667 \begin_inset Flex Code
1670 \begin_layout Plain Layout
1676 the old layout file and add\SpecialChar breakableslash
1677 remove\SpecialChar breakableslash
1678 obsolete\SpecialChar breakableslash
1679 modify settings and styles (similar
1681 \begin_inset Flex Code
1684 \begin_layout Plain Layout
1694 \begin_layout Standard
1695 It may be tempting to let the new layout be the
1696 \begin_inset Quotes eld
1700 \begin_inset Quotes erd
1703 and have the old layout import it.
1704 However, this should not be done because any changes to the new layout
1705 would need undo steps in the importing old layout.
1709 \begin_layout Itemize
1710 If the new LaTeX document class obsoletes the old one, update the example
1711 and template files to use the new layout.
1712 Add a note about the changes (preferably with a pointer to the documentation
1717 \begin_layout Standard
1718 This way, new documents based on the template or example will use the up-to-date
1719 document class version.
1723 \begin_layout Standard
1724 \begin_inset Newpage newpage
1730 \begin_layout Section
1734 \begin_layout Standard
1735 Automated tests are an important tool to detect bugs and regressions in
1736 software development.
1737 Some projects like gcc even require each bug fix to be accompanied by a
1738 test case for the automatic test suite, that would detect this bug.
1739 Testing interactive features automatically is of course very hard, but
1740 core functionality like document import and export can be tested quite
1741 easily, and some tests of this kind exist.
1744 \begin_layout Subsection
1748 \begin_layout Standard
1749 There are attempts to set up a suite of unit tests for LyX.
1752 \begin_layout Standard
1753 TODO: describe what is done and what is still to do.
1756 \begin_layout Subsection
1760 \begin_layout Standard
1761 The tex2lyx tests are located in the
1762 \begin_inset Flex Code
1765 \begin_layout Plain Layout
1771 subfolder of the \SpecialChar LyX
1772 source code distribution.
1773 The actual testing is performed by the simple python script
1774 \begin_inset Flex Code
1777 \begin_layout Plain Layout
1778 src/tex2lyx/test/runtests.py
1784 Each test consists of two files:
1785 \begin_inset Flex Code
1788 \begin_layout Plain Layout
1794 contains the \SpecialChar LaTeX
1795 code that should be tested.
1797 \begin_inset Flex Code
1800 \begin_layout Plain Layout
1806 contains the expected output of tex2lyx.
1807 When a test is run, the actual produced output is compared with the stored
1809 The test passes if both are identical.
1810 The test machinery is also able to generate a file
1811 \begin_inset Flex Code
1814 \begin_layout Plain Layout
1820 by exporting the produced .lyx file with \SpecialChar LyX
1822 This may be useful for roundtrip comparisons.
1825 \begin_layout Subsubsection
1829 \begin_layout Standard
1830 The tex2lyx tests can be run in several ways.
1832 \begin_inset Flex Code
1835 \begin_layout Plain Layout
1841 subfolder of the build directory, the commands
1842 \begin_inset Flex Code
1845 \begin_layout Plain Layout
1851 (cmake, all platforms),
1852 \begin_inset Flex Code
1855 \begin_layout Plain Layout
1861 (cmake, when using a make based build system and not MSVC) or
1862 \begin_inset Flex Code
1865 \begin_layout Plain Layout
1871 (autotools) will run the tex2lyx tests.
1872 Alternatively, in the root of the build directory, the command
1873 \begin_inset Flex Code
1876 \begin_layout Plain Layout
1882 runs all tests whose names match the regex
1883 \begin_inset Quotes eld
1887 \begin_inset Quotes erd
1891 Another way to run the tex2lyx tests in the root build directory is to
1892 instead use the command
1893 \begin_inset Flex Code
1896 \begin_layout Plain Layout
1897 ctest -L '(cmplyx|roundtrip)'
1902 , which runs all tests categorized with the label
1903 \begin_inset Quotes eld
1907 \begin_inset Quotes erd
1911 \begin_inset Quotes eld
1915 \begin_inset Quotes erd
1919 If a test fails, the differences between the expected and actual results
1920 are output in unified diff format.
1923 \begin_layout Subsubsection
1924 Updating test references
1925 \begin_inset CommandInset label
1927 name "sec:Updating-test-references"
1934 \begin_layout Standard
1935 In some cases a changed tex2lyx output is not a test failure, but wanted,
1937 \begin_inset space \thinspace{}
1941 \begin_inset space \space{}
1944 if a tex2lyx bug was fixed, or a new feature was added.
1945 In these cases the stored references need to be updated.
1946 To do so if using autotools, call
1947 \begin_inset Flex Code
1950 \begin_layout Plain Layout
1957 \begin_inset Flex Code
1960 \begin_layout Plain Layout
1966 subdirectory of the build directory.
1967 If instead using CMake, call
1968 \begin_inset Flex Code
1971 \begin_layout Plain Layout
1972 make updatetex2lyxtests
1977 in the build directory or in the
1978 \begin_inset Flex Code
1981 \begin_layout Plain Layout
1987 subdirectory of the build directory.
1991 \begin_layout Plain Layout
1992 Note that this is a case where a make target in the build directory can
1993 affect the source directory, which might not be advisable.
1998 On Windows do the following:
2001 \begin_layout Itemize
2002 Assure that the path to the python.exe is in your system PATH variable.
2005 \begin_layout Itemize
2006 Double-click on the file
2007 \begin_inset Flex Code
2010 \begin_layout Plain Layout
2011 updatetex2lyxtests.vcxproj
2016 in the build directory or in the
2017 \begin_inset Flex Code
2020 \begin_layout Plain Layout
2026 subdirectory of your build directory.
2029 \begin_layout Itemize
2030 In the appearing MSVC program assure that you build the
2034 version and then right-click on the project
2038 in the project explorer and chose
2045 \begin_layout Standard
2046 For convenience, these commands also produce re-exported roundtrip .lyx.tex
2048 Please examine the changed output carefully before committing the changed
2049 files to the repository: Since the test machinery does not do a roundtrip
2051 \begin_inset Formula $\Rightarrow$
2055 \begin_inset Formula $\Rightarrow$
2058 .tex, and does not compare the produced dvi or pdf output, it assumes that
2059 the stored .lyx reference produces correct output if processed by \SpecialChar LyX
2061 There is only one chance to detect wrong output: before committing a new
2063 Once it is committed, it is quite difficult to verify whether it is correct.
2066 \begin_layout Standard
2071 update the test references by opening them with \SpecialChar LyX
2072 or directly running lyx2lyx
2074 This would not work, since lyx2lyx and \SpecialChar LyX
2075 produce slightly different files
2076 regarding insignificant whitespace and line breaks.
2079 \begin_layout Subsubsection
2083 \begin_layout Standard
2084 In many cases tests for new features may be added to one of the existing
2085 test files, but sometimes this is not possible or not wanted.
2086 Then a new test file needs to be added:
2089 \begin_layout Enumerate
2091 \begin_inset Flex Code
2094 \begin_layout Plain Layout
2095 src/tex2lyx/test/<test name>.tex
2100 and run tex2lyx in roundtrip mode to produce the file
2101 \begin_inset Flex Code
2104 \begin_layout Plain Layout
2105 src/tex2lyx/test/<test name>.lyx.lyx
2111 This file will be the new reference.
2114 \begin_layout Enumerate
2115 Once you confirmed that the tex2lyx output is correct, add the new files
2116 to the corresponding lists in
2117 \begin_inset Flex Code
2120 \begin_layout Plain Layout
2121 src/tex2lyx/test/runtests.py
2127 \begin_inset Flex Code
2130 \begin_layout Plain Layout
2131 src/tex2lyx/Makefile.am
2137 \begin_inset Flex Code
2140 \begin_layout Plain Layout
2141 src/tex2lyx/test/CMakeLists.txt
2149 \begin_layout Enumerate
2150 Commit the changes to the repository, or send a patch to the development
2151 list and ask for committing if you do not have commit rights.
2154 \begin_layout Subsection
2155 ctest automatic tests
2158 \begin_layout Standard
2159 Some tests are located in the
2160 \begin_inset Flex Code
2163 \begin_layout Plain Layout
2164 development/autotests/
2169 subfolder of the \SpecialChar LyX
2170 source code distribution.
2175 \begin_layout Plain Layout
2176 The README document in this folder only describes the
2177 \begin_inset Quotes eld
2181 \begin_inset Quotes erd
2184 subset of autotests!
2192 \begin_layout Standard
2193 These tests can be run by the commands
2194 \begin_inset Flex Code
2197 \begin_layout Plain Layout
2207 (all platforms) or (when using a make based build system and not MSVC)
2209 \begin_inset Flex Code
2212 \begin_layout Plain Layout
2219 \begin_inset Flex Code
2222 \begin_layout Plain Layout
2233 The test logs are written to the
2234 \begin_inset Flex Code
2237 \begin_layout Plain Layout
2251 \begin_layout Subsubsection
2255 \begin_layout Standard
2256 The export tests are integration tests.
2257 They take longer to run and are more likely to break than the tex2lyx tests.
2258 Nevertheless, they have caught many regressions and without a better alternativ
2259 e it is important to keep them up-to-date and understand how they work.
2262 \begin_layout Standard
2264 \begin_inset Quotes eld
2268 \begin_inset Quotes erd
2271 documentation, template, and example documents.
2272 In addition, there are a number of dedicated sample documents in the
2273 \begin_inset Flex Code
2276 \begin_layout Plain Layout
2282 subfolder of the \SpecialChar LyX
2283 source code distribution.
2284 All samples are (after copying and eventual processing by scripts) exported
2285 to various output formats via the
2286 \begin_inset Flex Code
2289 \begin_layout Plain Layout
2295 command line option.
2296 The tests checks for errors reported by LyX.
2297 (However, error-free export is no guarantee for an error-free output document.)
2300 \begin_layout Paragraph
2301 \begin_inset CommandInset label
2303 name "par:when-to-run-an-export-test"
2307 Expectations of LyX developers
2310 \begin_layout Standard
2311 Because the export tests are integration tests and take a long time to run,
2312 LyX developers are rarely expected to run all of the tests.
2313 Here are some good practices to follow by developers:
2316 \begin_layout Itemize
2317 When making a non-trivial change to a .layout file, run the export and layout
2318 tests corresponding with that .layout file.
2321 \begin_layout Itemize
2322 When making non-trivial changes to a .lyx file, run the export tests correspondin
2323 g to that .lyx file.
2328 \begin_layout Plain Layout
2329 This rule is due to revision.
2333 \begin_layout Plain Layout
2334 There is an objection from the documentation maintainer that working on
2335 the documentation must not be complicated by having to consider non-standard
2339 \begin_layout Itemize
2340 successful compiling/testing an edited documentation file with pdflatex
2341 suffices to ensure it can be commited, not tests with other exports are
2345 \begin_layout Plain Layout
2346 If sudden failures with other exports due to “half-tested” documentation
2347 updates are a problem for the test maintainer, the test suite should use
2351 \begin_layout Itemize
2352 copied to a cache dir (autotests/samples/doc/, say) but not changed,
2355 \begin_layout Itemize
2356 updated regularely (but on a time chosen by the test suite maintainer) from
2357 the originals in lib/doc/
2360 \begin_layout Plain Layout
2364 \begin_layout Itemize
2365 no test will fail due to ongoing work on documentation,
2368 \begin_layout Itemize
2369 the documentation is still tested in full (with some delay),
2372 \begin_layout Itemize
2373 failures with non-default export can be examined and handled accordingly
2374 in one run with the cache update,
2377 \begin_layout Itemize
2378 “interesting failures” (like the nested-language+polyglossia problem in
2379 es/Customization can be separated and moved into dedicated test samples.
2387 \begin_layout Itemize
2388 When making non-trivial changes to LyX's \SpecialChar LaTeX
2390 touching the encoding code or package handling code that you expect will
2391 change the exported \SpecialChar LaTeX
2396 \begin_layout Standard
2397 \paragraph_spacing single
2398 Consider running all of the export tests before and after your change.
2399 If there are differences, please reconcile these (i.e.
2400 fix the bug or fix the tests)
2405 Ask for help if you're not sure what to.
2408 \begin_layout Standard
2409 If you do not want to run the tests,
2412 \begin_layout Itemize
2413 post the patch on the list and others will run the tests and eventually
2417 \begin_layout Itemize
2418 commit, but be prepared to fix eventually arising problems or to revert
2419 the commit if there is no easy fix.
2423 \begin_layout Itemize
2424 Understand how to interpret test failures.
2425 If your commit is found to have broken a test, you should be able to interpret
2426 the test results when made aware of them.
2428 \begin_inset CommandInset ref
2430 reference "subsec:Interpreting-export-tests"
2437 \begin_layout Paragraph
2438 \begin_inset CommandInset label
2440 name "par:export-test-output-formats"
2447 \begin_layout Standard
2448 The following output formats are currently tested for each sample document
2450 \begin_inset CommandInset ref
2452 reference "par:Export-test-filtering"
2459 \begin_layout Labeling
2460 \labelwidthstring 00.00.0000
2465 \begin_layout Labeling
2466 \labelwidthstring 00.00.0000
2467 lyx16 LyX 1.6 file format (lyx2lyx)
2470 \begin_layout Labeling
2471 \labelwidthstring 00.00.0000
2472 lyx21 LyX 2.1 file format (lyx2lyx)
2475 \begin_layout Labeling
2476 \labelwidthstring 00.00.0000
2477 xhtml LyXHTML (native LyX HTML export)
2481 \begin_layout Labeling
2482 \labelwidthstring 00.00.0000
2484 \begin_inset space ~
2488 \begin_inset space ~
2495 \begin_layout Labeling
2496 \labelwidthstring pdf5msystemFM
2497 dvi DVI (8-bit latex)
2500 \begin_layout Labeling
2501 \labelwidthstring pdf5msystemFM
2502 dvi3_texF DVI (LuaTeX with 8-bit TeX fonts)
2505 \begin_layout Labeling
2506 \labelwidthstring pdf5msystemFM
2507 dvi3_systemF DVI (LuaTeX with Unicode fonts)
2510 \begin_layout Labeling
2511 \labelwidthstring pdf5msystemFM
2515 \begin_layout Labeling
2516 \labelwidthstring pdf5msystemFM
2517 pdf4_texF PDF (XeTeX with 8-bit TeX fonts)
2520 \begin_layout Labeling
2521 \labelwidthstring pdf5msystemFM
2522 pdf4_systemF PDF (XeTeX with Unicode fonts)
2525 \begin_layout Labeling
2526 \labelwidthstring pdf5msystemFM
2527 pdf5_texF PDF (LuaTeX with 8-bit TeX fonts)
2530 \begin_layout Labeling
2531 \labelwidthstring pdf5msystemFM
2532 pdf5_systemF PDF (LuaTeX with Unicode fonts)
2536 \begin_layout Labeling
2537 \labelwidthstring 00.00.0000
2539 \begin_inset space ~
2543 \begin_inset space ~
2547 \begin_inset space ~
2551 \begin_inset space ~
2558 \begin_layout Labeling
2559 \labelwidthstring pdf5msystemFM
2560 pdf DVI -> PS (dvips) -> PDF (ps2pdf)
2563 \begin_layout Labeling
2564 \labelwidthstring pdf5msystemFM
2565 pdf3 DVI -> PDF (dvipdfm)
2569 \begin_layout Labeling
2570 \labelwidthstring 00.00.0000
2572 \begin_inset space ~
2575 tested: (or only if set as default output format in the document source)
2579 \begin_layout Labeling
2580 \labelwidthstring pdf5msystemFM
2584 \begin_layout Labeling
2585 \labelwidthstring pdf5msystemFM
2586 luatex LaTeX (LuaTeX)
2589 \begin_layout Labeling
2590 \labelwidthstring pdf5msystemFM
2591 dviluatex LaTeX (dviluatex)
2594 \begin_layout Labeling
2595 \labelwidthstring pdf5msystemFM
2596 pdflatex LaTeX (pdflatex)
2599 \begin_layout Labeling
2600 \labelwidthstring pdf5msystemFM
2601 platex LaTeX (pLaTeX)
2604 \begin_layout Labeling
2605 \labelwidthstring pdf5msystemFM
2609 \begin_layout Labeling
2610 \labelwidthstring pdf5msystemFM
2611 eps3 EPS (encapsulated Postscript) (cropped)
2614 \begin_layout Labeling
2615 \labelwidthstring pdf5msystemFM
2616 ps DVI -> Postscript (dvips)
2619 \begin_layout Labeling
2620 \labelwidthstring pdf5msystemFM
2624 \begin_layout Labeling
2625 \labelwidthstring pdf5msystemFM
2626 text (nor text2, ..., text4)
2629 \begin_layout Labeling
2630 \labelwidthstring pdf5msystemFM
2634 \begin_layout Labeling
2635 \labelwidthstring pdf5msystemFM
2639 \begin_layout Labeling
2640 \labelwidthstring pdf5msystemFM
2644 \begin_layout Labeling
2645 \labelwidthstring pdf5msystemFM
2650 \begin_layout Paragraph
2651 \begin_inset CommandInset label
2653 name "par:Configuring-ctests"
2657 Configuring the tests
2660 \begin_layout Standard
2661 To enable the export autotests, add the
2662 \begin_inset Flex Code
2665 \begin_layout Plain Layout
2666 -DLYX_ENABLE_EXPORT_TESTS=ON
2675 \begin_layout Standard
2676 \begin_inset Flex Code
2679 \begin_layout Plain Layout
2680 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
2688 \begin_layout Standard
2690 This flag will increase the time for the cmake command by several seconds,
2691 mainly because of the process of inverting tests (see Section
2692 \begin_inset CommandInset ref
2694 reference "subsec:Interpreting-export-tests"
2701 \begin_layout Paragraph
2702 \begin_inset CommandInset label
2704 name "par:ctest-options"
2711 \begin_layout Standard
2712 To run all tests, in the build directory simply run the command
2713 \begin_inset Flex Code
2716 \begin_layout Plain Layout
2723 A full, up-to-date TeXLive installation is recommended to run the tests.
2724 Otherwise, some tests will fail.
2725 Tests with additional requirements are labeled
2726 \begin_inset Quotes eld
2729 unreliable:nonstandard
2730 \begin_inset Quotes erd
2737 \begin_layout Standard
2738 To run only some of the tests, use command line options (see examples below):
2741 \begin_layout Labeling
2742 \labelwidthstring -R
2743 \begin_inset Flex Code
2746 \begin_layout Plain Layout
2752 Run only the tests whose names match the given regular expression.
2755 \begin_layout Labeling
2756 \labelwidthstring -R
2757 \begin_inset Flex Code
2760 \begin_layout Plain Layout
2766 Run only the tests whose labels match the given regular expression.
2767 A test may have more that one label.
2771 \begin_layout Labeling
2772 \labelwidthstring -R
2773 \begin_inset Flex Code
2776 \begin_layout Plain Layout
2782 Exclude the tests whose names match the given regular expression.
2785 \begin_layout Labeling
2786 \labelwidthstring -R
2787 \begin_inset Flex Code
2790 \begin_layout Plain Layout
2796 Exclude the tests whose labels match the given regular expression.
2797 Cannot be combined with
2798 \begin_inset Flex Code
2801 \begin_layout Plain Layout
2810 \begin_layout Standard
2811 The following options help to find good selection patterns:
2814 \begin_layout Labeling
2815 \labelwidthstring -R
2816 \begin_inset Flex Code
2819 \begin_layout Plain Layout
2825 List the tests that would be run but not actually run them.
2830 \begin_layout Standard
2831 Useful in conjunction with the -R, -L, -E and -LE options, e.g., if you want
2832 to know how many tests there are or whether your
2833 \begin_inset Flex Code
2836 \begin_layout Plain Layout
2842 regular expression did what you expected.
2846 \begin_layout Labeling
2847 \labelwidthstring -R
2848 \begin_inset Flex Code
2851 \begin_layout Plain Layout
2852 \SpecialChar nobreakdash
2853 \SpecialChar nobreakdash
2859 print the list of all labels associated with the test set.
2860 Can also be combined with -R, -L, -E, ...
2864 \begin_layout Standard
2865 Other useful options are:
2868 \begin_layout Labeling
2869 \labelwidthstring -R
2870 \begin_inset Flex Code
2873 \begin_layout Plain Layout
2879 Run the tests in parallel using the given number of jobs.
2883 \begin_layout Standard
2884 We are still working on getting the tests to run in parallel.
2885 However, when running the tests in parallel, sometimes tests fail that
2886 pass when run sequentially.
2887 A reasonable approach is to first run the tests in parallel and then run
2888 the failed tests sequentially.
2891 \begin_layout Standard
2892 For example, to run 8 jobs at a time:
2895 \begin_layout Standard
2896 \begin_inset Flex Code
2899 \begin_layout Plain Layout
2908 \begin_layout Standard
2909 \begin_inset Flex Code
2912 \begin_layout Plain Layout
2913 ctest \SpecialChar nobreakdash
2914 \SpecialChar nobreakdash
2923 \begin_layout Standard
2924 When specifying a subset of the tests (e.g.
2926 \begin_inset Flex Code
2929 \begin_layout Plain Layout
2930 \SpecialChar nobreakdash
2936 ), the same subset must be specified when using the
2937 \begin_inset Flex Code
2940 \begin_layout Plain Layout
2941 \SpecialChar nobreakdash
2942 \SpecialChar nobreakdash
2948 option because it is the test numbers that are used to index which tests
2949 failed on the previous run.
2952 \begin_layout Standard
2954 Note that some tests cannot be run in parallel.
2955 These tests are marked in the code with the
2956 \begin_inset Flex Code
2959 \begin_layout Plain Layout
2970 \begin_layout Labeling
2971 \labelwidthstring -R
2972 \begin_inset Flex Code
2975 \begin_layout Plain Layout
2976 \SpecialChar nobreakdash
2977 \SpecialChar nobreakdash
2983 Set a global timeout on all tests that do not already have a timeout set
2988 \begin_layout Standard
2989 There have been bugs in LyX and in \SpecialChar LaTeX
2990 which cause compilation to hang, and
2991 without a timeout a test might never stop (in one case there was even a
2993 If a test times out, the
2994 \begin_inset Flex Code
2997 \begin_layout Plain Layout
3003 command exits with error, but you can distinguish between a timed out test
3004 and a failed test in the output reported at the end of the
3005 \begin_inset Flex Code
3008 \begin_layout Plain Layout
3018 \begin_layout Standard
3020 \begin_inset Flex Code
3023 \begin_layout Plain Layout
3029 ) the full list of command line options.
3032 \begin_layout Paragraph
3036 \begin_layout Itemize
3037 run only the export tests:
3038 \begin_inset Flex Code
3041 \begin_layout Plain Layout
3050 \begin_layout Itemize
3052 \begin_inset Flex Code
3055 \begin_layout Plain Layout
3056 ctest -L "inverted|suspended"
3064 \begin_layout Itemize
3065 list all export tests which match any of the labelling patterns:
3066 \begin_inset Flex Code
3069 \begin_layout Plain Layout
3080 \begin_layout Itemize
3081 exclude rarely used output formats and post-processing tests
3082 \begin_inset Flex Code
3085 \begin_layout Plain Layout
3086 ctest -L export -E "_(texF|dvi3|pdf3?)"
3094 \begin_layout Paragraph
3095 \begin_inset CommandInset label
3097 name "subsec:Interpreting-export-tests"
3101 Interpreting the export test results
3104 \begin_layout Standard
3105 A test can fail for several reasons, not all of them bad.
3108 \begin_layout Enumerate
3109 A new or edited sample document may be incompatible with some output formats.
3112 \begin_layout Enumerate
3113 A dependency is not met (e.g.
3114 the \SpecialChar LaTeX
3116 One hint that this is the case is that the corresponding
3117 \begin_inset Flex Code
3120 \begin_layout Plain Layout
3126 test will likely also fail.
3129 \begin_layout Enumerate
3130 An inverted test fails to fail (i.e.
3131 export that previously failed now works).
3134 \begin_layout Enumerate
3135 An external dependency was updated (e.g.
3140 \begin_layout Enumerate
3141 A recent code change introduced a bug.
3144 \begin_layout Enumerate
3145 \begin_inset CommandInset label
3151 A change in a document exposed a previously unknown bug or an incompatibility
3152 with an export format (e.g.
3153 Lua\SpecialChar LaTeX
3157 \begin_layout Standard
3158 Because the .lyx files are exported in several formats, it is not surprising
3159 that many of the exports fail.
3160 This expectation of failure is addressed by
3161 \begin_inset Quotes eld
3165 \begin_inset Quotes erd
3168 the tests, that is, by marking the test as
3169 \begin_inset Quotes eld
3173 \begin_inset Quotes erd
3176 if the export exits with error and as
3177 \begin_inset Quotes eld
3181 \begin_inset Quotes erd
3184 if the export succeeds
3189 It follows that these expected failures will not show up as failed tests
3190 in the test results and thus will not pollute the
3191 \begin_inset Quotes eld
3195 \begin_inset Quotes erd
3199 If the export actually succeeds, then the test will fail.
3200 The purpose of this failure is to get your attention—something has changed,
3201 possibly for the better.
3204 \begin_layout Standard
3205 We try to document why a test is inverted or ignored.
3206 See the comment (prefixed with
3207 \begin_inset Flex Code
3210 \begin_layout Plain Layout
3216 ) above the block in which the test is listed as inverted or ignored in
3218 \begin_inset Flex Code
3221 \begin_layout Plain Layout
3222 development/autotests/invertedTests
3228 \begin_inset Flex Code
3231 \begin_layout Plain Layout
3232 development/autotests/unreliableTests
3238 \begin_inset Flex Code
3241 \begin_layout Plain Layout
3242 development/autotests/ignoredTests
3251 \begin_layout Standard
3252 A good question is why do we enable the tests for non-default formats? The
3253 answer is that if a non-default route is broken it is often because a bug
3254 was introduced in LyX and not because a document-specific change was made
3255 that is not supported by the route.
3256 In other words, there is a high signal/noise ratio in the export tests
3257 for some non-default formats.
3261 \begin_layout Standard
3262 When a test or several tests fail, consider checking the files in the
3263 \begin_inset Flex Code
3266 \begin_layout Plain Layout
3272 subdirectory of your build directory.
3273 In this subdirectory are three files: the file
3274 \begin_inset Flex Code
3277 \begin_layout Plain Layout
3283 simply lists the tests that failed on your last
3284 \begin_inset Flex Code
3287 \begin_layout Plain Layout
3294 \begin_inset Flex Code
3297 \begin_layout Plain Layout
3303 file contains the output from the tests (and often has details explaining
3304 why a test failed); and the
3305 \begin_inset Flex Code
3308 \begin_layout Plain Layout
3314 file lists the times that it took to run the tests.
3317 \begin_layout Paragraph
3318 What action should you take if a test fails?
3321 \begin_layout Standard
3322 \paragraph_spacing single
3323 It is always good to check manually why something fails and if it passes
3324 if the PDF output is good.
3327 \begin_layout Itemize
3328 Generally, if a change breaks compilation for the target format (for the
3329 manuals pdf2) without solving some important other issue,
3331 fix or revert the commit
3333 that led to failure.
3336 \begin_layout Itemize
3337 If it is not possible to (immediately) fix the failure but there are reasons
3338 not to revert the commit (e.g.
3339 it fixes another more important issue),
3343 the failing test case (see
3344 \begin_inset CommandInset ref
3346 reference "par:Inverted-tests"
3353 \begin_layout Itemize
3358 test case fails because the export now works,
3362 the test by removing the pattern from the
3363 \begin_inset Quotes eld
3367 \begin_inset Quotes erd
3371 \begin_inset CommandInset ref
3373 reference "par:Inverted-tests"
3380 \begin_layout Itemize
3381 If the export did not fail previously but led to wrong output (PDF, say),
3385 \begin_layout Plain Layout
3386 Non-failing test with wrong output should be labeledas
3387 \begin_inset Quotes eld
3390 unreliable:wrong_output
3391 \begin_inset Quotes erd
3395 \begin_inset CommandInset ref
3397 reference "par:Unreliable-tests"
3406 it is in fact an improvement when the test now fails.
3411 the failing test case (see
3412 \begin_inset CommandInset ref
3414 reference "par:Inverted-tests"
3421 \begin_layout Itemize
3422 In case of tests failing due to missing requirements (tests labeled
3423 \begin_inset Quotes eld
3426 unreliable:nonstandard
3427 \begin_inset Quotes erd
3430 or testing on a system with only a subset of TeXLive installed), ignore
3431 the failure, ask for someone else to run the test, or install the missing
3432 resources and try again.
3435 \begin_layout Itemize
3436 Check the log file Testing/Temporary/LastTest.log.
3437 In case of latex-errors rerun the failing test with environment variable
3438 'LAX_DEBUG_LATEX' set to '1'.
3439 This will include latex messages in LastTest.log, so it should be easier
3440 to interpret the fail-reason.
3443 \begin_layout Paragraph
3444 \begin_inset CommandInset label
3446 name "par:Inverted-tests"
3453 \begin_layout Standard
3454 Test cases whose name matches a pattern in the file
3455 \begin_inset Flex Code
3458 \begin_layout Plain Layout
3459 development/autotests/invertedTests
3469 They get also the test property
3470 \begin_inset Flex Code
3473 \begin_layout Plain Layout
3480 they are reported as failing if the export works without error
3481 \begin_inset Flex URL
3484 \begin_layout Plain Layout
3486 https://cmake.org/cmake/help/v3.0/command/set_tests_properties.html
3494 \begin_layout Standard
3495 Add failing cases to this file, if they cannot be solved
3496 \begin_inset Quotes eld
3500 \begin_inset Quotes erd
3503 but it is expected that the export will work in a foreseeable future, e.g.
3504 low priority issues like failures to export to a non-target format (for
3505 the manuals everything except pdf2).
3508 \begin_layout Standard
3509 The following sublabels are currently present in
3510 \begin_inset Flex Code
3513 \begin_layout Plain Layout
3522 \begin_layout Description
3523 todo test failures that require attention:
3527 \begin_layout Itemize
3528 minor issues to explore and properly sort later,
3531 \begin_layout Itemize
3535 \begin_layout Itemize
3536 LyX bugs to report at trac (move pattern to section "lyxbugs" once done).
3540 \begin_layout Description
3541 lyxbugs LyX bugs with a Trac number.
3544 \begin_layout Description
3545 ert Export failures due to "raw" LaTeX use in ERT or preamble code.
3549 \begin_layout Standard
3550 "Wontfix" if demonstrating correct use and OK in the default output format.
3554 \begin_layout Description
3555 texissues Export fails due to LaTeX limitations like non-ASCII characters
3556 in verbatim or listings, incompatible packages, ...
3560 \begin_layout Standard
3561 "Wontfix" if documents demonstrate correct use in the default output format:
3564 \begin_layout Itemize
3565 If the source can be made more robust without becoming "hackish", fix the
3569 \begin_layout Itemize
3570 if LyX could be enhanced to care for a permanent TeX limitation, file a
3571 ticket at trac and add a pattern under lyxbugs,
3574 \begin_layout Itemize
3575 otherwise, add a pattern here.
3579 \begin_layout Description
3580 attic Documents in the attic (kept for reference and format conversion test).
3582 \begin_inset Quotes eld
3586 \begin_inset Quotes erd
3592 \begin_layout Subparagraph
3596 \begin_layout Standard
3597 Test cases whose name additionally matches a pattern in the file
3598 \begin_inset Flex Code
3601 \begin_layout Plain Layout
3602 development/autotests/suspendedTests
3620 This means they are not executed using
3621 \begin_inset Flex Code
3624 \begin_layout Plain Layout
3631 \begin_inset Flex Code
3634 \begin_layout Plain Layout
3641 However, they also get the test property
3642 \begin_inset Flex Code
3645 \begin_layout Plain Layout
3652 they are reported as failing if the export works without error.
3653 From time to time they still have to be checked using
3654 \begin_inset Flex Code
3657 \begin_layout Plain Layout
3666 \begin_layout Standard
3667 These tests are suspended, because the export fails for known reasons which
3668 cannot ATM be resolved.
3669 But it is expected the reason might disappear in the future.
3670 Be it new TL or better handling in \SpecialChar LyX
3674 \begin_layout Standard
3675 For ctest commands without the
3676 \begin_inset Flex Code
3679 \begin_layout Plain Layout
3685 parameter nothing changes.
3686 Suspended or not, tests will be executed depending only on the selecting
3687 regular expression given to the ctest command (see
3688 \begin_inset CommandInset ref
3690 reference "par:ctest-options"
3697 \begin_layout Paragraph
3698 \begin_inset CommandInset label
3700 name "par:Unreliable-tests"
3707 \begin_layout Standard
3708 Test cases whose name matches a pattern in the file
3709 \begin_inset Flex Code
3712 \begin_layout Plain Layout
3713 development/autotests/unreliableTests
3725 \begin_layout Standard
3726 These tests are not executed using
3727 \begin_inset Flex Code
3730 \begin_layout Plain Layout
3737 \begin_inset Flex Code
3740 \begin_layout Plain Layout
3750 \begin_layout Standard
3751 They pass or fail for various reasons not related to LyX (nonstandard, erratic)
3752 or pass but should rather fail (wrong output).
3754 \begin_inset Note Note
3757 \begin_layout Plain Layout
3758 *invalid* tests (wrong output) are not *unreliable*.
3759 # Use "unfit" or "unapplicable" as better label and name of pattern file?
3768 \begin_layout Standard
3769 The following sublabels are currently present in
3770 \begin_inset Flex Code
3773 \begin_layout Plain Layout
3782 \begin_layout Description
3783 nonstandard Documents with additional requirements, e.g.
3784 a class or package file not in TeXLive.
3786 \begin_inset Note Note
3789 \begin_layout Plain Layout
3791 \begin_inset Quotes eld
3795 \begin_inset Quotes erd
3799 \begin_inset Quotes eld
3803 \begin_inset Quotes erd
3814 \begin_layout Description
3815 erratic Tests depending on local configuration or the phase of the moon.
3819 \begin_layout Description
3820 varying_versions Test depending on TeX distribution, package versions or
3824 \begin_layout Description
3826 \begin_inset space ~
3829 output Export does not fail but the resulting document has (undetected)
3834 \begin_layout Standard
3835 \paragraph_spacing single
3836 \begin_inset Note Note
3839 \begin_layout Plain Layout
3840 \paragraph_spacing single
3841 These tests are in a strict sense not unreliable but
3845 (not measuring what they should measure).
3854 \begin_layout Paragraph
3855 \begin_inset CommandInset label
3857 name "par:Export-test-filtering"
3861 Export test filtering
3864 \begin_layout Standard
3865 The assignment of a label to a test is controlled by a set of files with
3866 regular expressions that are matched against the test names.
3869 \begin_layout Description
3870 ignoredTests (small file)
3871 \begin_inset Newline newline
3874 Tests selected here are withdrawn in the configuration step (cf.
3876 \begin_inset CommandInset ref
3878 reference "par:Configuring-ctests"
3886 \begin_layout Labeling
3887 \labelwidthstring 00.00.0000
3888 Input Test of any export combination
3891 \begin_layout Labeling
3892 \labelwidthstring 00.00.0000
3893 Output Stop if tests not selected here
3897 \begin_layout Description
3898 unreliableTests: Tests selected pass or fail dependent on the system where
3900 Selected tests gain the label 'unreliable'.
3904 \begin_layout Labeling
3905 \labelwidthstring 00.00.0000
3906 Input Each test which passed 'ignoredTests'
3909 \begin_layout Labeling
3910 \labelwidthstring 00.00.0000
3911 Output Stop if test selected, gain label 'unreliable'.
3915 \begin_layout Description
3917 \begin_inset space \space{}
3924 \begin_layout Labeling
3925 \labelwidthstring 00.00.0000
3926 Input Each test which passed 'unreliableTests'
3929 \begin_layout Labeling
3930 \labelwidthstring 00.00.0000
3931 Output Stop if not selected, gain test-property 'WILL_FAIL' (i.e.
3932 tests are reported as failing if the export works without error.) If no
3933 subselection applies, gain labels 'export' and 'inverted'.
3936 \begin_layout Standard
3937 The following filter perfoms a subselection of 'invertedTests':
3940 \begin_layout Description
3941 suspendedTests Tests selected here gain the label 'suspended' but _not_
3942 'export' or 'inverted', although in ctest they remain inverted.
3943 ('ctest' knows only 'inverted' or not, labels are used only for test selection)
3947 \begin_layout Labeling
3948 \labelwidthstring 00.00.0000
3949 Input Each test selected by 'invertedTests'
3952 \begin_layout Labeling
3953 \labelwidthstring 00.00.0000
3954 Output Selected test gains label 'suspended'.
3960 \begin_layout Standard
3961 The following table may clarify label assignement
3964 \begin_layout Standard
3965 \begin_inset Tabular
3966 <lyxtabular version="3" rows="7" columns="9">
3967 <features tabularvalignment="middle">
3968 <column alignment="left" valignment="top" width="0pt">
3969 <column alignment="left" valignment="top" width="0pt">
3970 <column alignment="left" valignment="top" width="0pt">
3971 <column alignment="left" valignment="top" width="0pt">
3972 <column alignment="center" valignment="top">
3973 <column alignment="center" valignment="top">
3974 <column alignment="center" valignment="top">
3975 <column alignment="center" valignment="top">
3976 <column alignment="center" valignment="top">
3978 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3981 \begin_layout Plain Layout
3982 Test matching pattern in file:
3987 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3990 \begin_layout Plain Layout
3996 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3999 \begin_layout Plain Layout
4005 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4008 \begin_layout Plain Layout
4014 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4017 \begin_layout Plain Layout
4023 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4026 \begin_layout Plain Layout
4032 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4035 \begin_layout Plain Layout
4041 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4044 \begin_layout Plain Layout
4050 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4053 \begin_layout Plain Layout
4061 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4064 \begin_layout Plain Layout
4070 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4073 \begin_layout Plain Layout
4079 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4082 \begin_layout Plain Layout
4088 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4091 \begin_layout Plain Layout
4097 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4100 \begin_layout Plain Layout
4106 <cell alignment="center" valignment="top" topline="true" usebox="none">
4109 \begin_layout Plain Layout
4115 <cell alignment="center" valignment="top" topline="true" usebox="none">
4118 \begin_layout Plain Layout
4124 <cell alignment="center" valignment="top" topline="true" usebox="none">
4127 \begin_layout Plain Layout
4133 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4136 \begin_layout Plain Layout
4144 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4147 \begin_layout Plain Layout
4153 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4156 \begin_layout Plain Layout
4162 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4165 \begin_layout Plain Layout
4171 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4174 \begin_layout Plain Layout
4180 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4183 \begin_layout Plain Layout
4189 <cell alignment="center" valignment="top" topline="true" usebox="none">
4192 \begin_layout Plain Layout
4198 <cell alignment="center" valignment="top" topline="true" usebox="none">
4201 \begin_layout Plain Layout
4207 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4210 \begin_layout Plain Layout
4216 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4219 \begin_layout Plain Layout
4227 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4230 \begin_layout Plain Layout
4236 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4239 \begin_layout Plain Layout
4245 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4248 \begin_layout Plain Layout
4254 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4257 \begin_layout Plain Layout
4263 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4266 \begin_layout Plain Layout
4272 <cell alignment="center" valignment="top" topline="true" usebox="none">
4275 \begin_layout Plain Layout
4281 <cell alignment="center" valignment="top" topline="true" usebox="none">
4284 \begin_layout Plain Layout
4290 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4293 \begin_layout Plain Layout
4299 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4302 \begin_layout Plain Layout
4310 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
4313 \begin_layout Plain Layout
4319 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4322 \begin_layout Plain Layout
4328 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4331 \begin_layout Plain Layout
4337 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4340 \begin_layout Plain Layout
4346 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4349 \begin_layout Plain Layout
4355 <cell alignment="center" valignment="top" topline="true" usebox="none">
4358 \begin_layout Plain Layout
4364 <cell alignment="center" valignment="top" topline="true" usebox="none">
4367 \begin_layout Plain Layout
4373 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4376 \begin_layout Plain Layout
4382 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4385 \begin_layout Plain Layout
4393 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4396 \begin_layout Plain Layout
4402 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4405 \begin_layout Plain Layout
4411 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4414 \begin_layout Plain Layout
4420 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4423 \begin_layout Plain Layout
4429 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4432 \begin_layout Plain Layout
4438 <cell alignment="center" valignment="top" topline="true" usebox="none">
4441 \begin_layout Plain Layout
4447 <cell alignment="center" valignment="top" topline="true" usebox="none">
4450 \begin_layout Plain Layout
4456 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4459 \begin_layout Plain Layout
4465 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4468 \begin_layout Plain Layout
4476 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4479 \begin_layout Plain Layout
4485 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4488 \begin_layout Plain Layout
4494 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4497 \begin_layout Plain Layout
4503 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4506 \begin_layout Plain Layout
4512 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4515 \begin_layout Plain Layout
4521 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4524 \begin_layout Plain Layout
4530 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4533 \begin_layout Plain Layout
4539 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4542 \begin_layout Plain Layout
4548 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4551 \begin_layout Plain Layout
4565 \begin_layout Standard
4566 \begin_inset Note Note
4569 \begin_layout Plain Layout
4571 \begin_inset Quotes eld
4575 \begin_inset Quotes erd
4578 filter, this would be far less complicated:
4581 \begin_layout Plain Layout
4582 \begin_inset Tabular
4583 <lyxtabular version="3" rows="6" columns="7">
4584 <features tabularvalignment="middle">
4585 <column alignment="left" valignment="top" width="0pt">
4586 <column alignment="left" valignment="top" width="0pt">
4587 <column alignment="left" valignment="top" width="0pt">
4588 <column alignment="center" valignment="top">
4589 <column alignment="center" valignment="top">
4590 <column alignment="center" valignment="top">
4591 <column alignment="center" valignment="top">
4593 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4596 \begin_layout Plain Layout
4597 Test matching pattern in file:
4602 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4605 \begin_layout Plain Layout
4611 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4614 \begin_layout Plain Layout
4620 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4623 \begin_layout Plain Layout
4629 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4632 \begin_layout Plain Layout
4638 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4641 \begin_layout Plain Layout
4647 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4650 \begin_layout Plain Layout
4658 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4661 \begin_layout Plain Layout
4667 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4670 \begin_layout Plain Layout
4676 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4679 \begin_layout Plain Layout
4685 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4688 \begin_layout Plain Layout
4694 <cell alignment="center" valignment="top" topline="true" usebox="none">
4697 \begin_layout Plain Layout
4703 <cell alignment="center" valignment="top" topline="true" usebox="none">
4706 \begin_layout Plain Layout
4712 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4715 \begin_layout Plain Layout
4723 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4726 \begin_layout Plain Layout
4732 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4735 \begin_layout Plain Layout
4741 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4744 \begin_layout Plain Layout
4750 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4753 \begin_layout Plain Layout
4759 <cell alignment="center" valignment="top" topline="true" usebox="none">
4762 \begin_layout Plain Layout
4768 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4771 \begin_layout Plain Layout
4777 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4780 \begin_layout Plain Layout
4788 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4791 \begin_layout Plain Layout
4797 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4800 \begin_layout Plain Layout
4806 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4809 \begin_layout Plain Layout
4815 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4818 \begin_layout Plain Layout
4824 <cell alignment="center" valignment="top" topline="true" usebox="none">
4827 \begin_layout Plain Layout
4833 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4836 \begin_layout Plain Layout
4842 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4845 \begin_layout Plain Layout
4853 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
4856 \begin_layout Plain Layout
4862 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4865 \begin_layout Plain Layout
4871 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4874 \begin_layout Plain Layout
4880 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4883 \begin_layout Plain Layout
4889 <cell alignment="center" valignment="top" topline="true" usebox="none">
4892 \begin_layout Plain Layout
4898 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4901 \begin_layout Plain Layout
4907 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4910 \begin_layout Plain Layout
4918 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4921 \begin_layout Plain Layout
4927 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4930 \begin_layout Plain Layout
4936 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4939 \begin_layout Plain Layout
4945 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4948 \begin_layout Plain Layout
4954 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4957 \begin_layout Plain Layout
4963 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4966 \begin_layout Plain Layout
4972 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4975 \begin_layout Plain Layout
4994 \begin_layout Subsubsection
4998 \begin_layout Standard
4999 These tests check whether a .lyx file loads without any terminal messages.
5000 They correspond to the manual operations of simply opening a .lyx file on
5001 the terminal, exiting LyX once the file is loaded, and then checking whether
5002 there is any output from the terminal.
5003 These tests are useful for catching malformed .lyx files and parsing bugs.
5004 They can also be used to find a .lyx file in which an instance of something
5006 To do this, compile LyX with a local patch that outputs something to the
5007 terminal when an instance is found, and then run the check_load tests to
5008 see if any fail, which would mean that the situation occurs in the LyX
5009 documentation files corresponding to the failed tests.
5010 These tests are expectedly fragile: any LyX diagnostic message, which is
5011 not necessarily an error, would cause the tests to fail.
5012 Similarly, any message output by a library (e.g.
5013 Qt) would also cause failure.
5014 There are some messages that the check_load tests are instructed to ignore,
5015 which are stored in the file
5016 \begin_inset Flex Code
5019 \begin_layout Plain Layout
5020 development/autotests/filterCheckWarnings
5028 \begin_layout Standard
5029 Under cmake, the tests are labeled as 'load'.
5032 \begin_layout Subsubsection
5036 \begin_layout Standard
5037 Automated tests based on the "MonKey Testing" keytest program are enabled
5038 if the necessary dependencies are found and if the CMake flag
5039 \begin_inset Flex Code
5042 \begin_layout Plain Layout
5043 -DLYX_ENABLE_KEYTESTS=ON
5049 They are documented in the README document in
5050 \begin_inset Flex Code
5053 \begin_layout Plain Layout
5054 development/autotests
5059 subfolder of the \SpecialChar LyX
5060 source code distribution.
5063 \begin_layout Subsubsection
5067 \begin_layout Standard
5068 These tests combine lyx2lyx tests with check_load tests.
5069 They fail if either fails.
5072 \begin_layout Subsubsection
5076 \begin_layout Standard
5077 The URL tests are enabled with the
5078 \begin_inset Flex Code
5081 \begin_layout Plain Layout
5082 -DLYX_ENABLE_URLTESTS=ON
5087 CMake flag and are useful for finding broken links in our documentation
5089 If a URL test fails, to see which link in particular was reported as broken,
5091 \begin_inset Flex Code
5094 \begin_layout Plain Layout
5101 These tests are extremely fragile (e.g.
5102 a test can depend on your Internet connection) and a failed URL test should
5103 not be taken too seriously.
5104 URL tests are labeled as
5109 \begin_layout Paragraph
5113 \begin_layout Standard
5114 cmake is required to run the \SpecialChar LyX
5115 tests, running them is not implemented for
5119 \begin_layout Standard
5120 The appropriate commands are:
5123 \begin_layout Itemize
5129 \begin_inset Newline newline
5132 runs all tests with label
5137 \begin_layout Itemize
5140 ctest -R 'check_.*urls'
5143 \begin_inset Newline newline
5146 runs the tests 'check_accessible_urls'
5149 \begin_layout Standard
5150 Associated test results can be examined in ctest-log directory in files
5151 of the form 'LastFailed.*URLS.log'
5154 \begin_layout Section
5155 Development policies
5158 \begin_layout Standard
5159 This chapter lists some guidelines that should be followed.
5160 This list is not complete, and many guidelines are in separate chapters,
5162 \begin_inset Quotes eld
5165 When is an update of the .lyx file format number needed?
5166 \begin_inset Quotes erd
5170 \begin_inset CommandInset ref
5172 reference "sec:When-is-an"
5179 \begin_layout Subsection
5180 When to set a fixed milestone?
5183 \begin_layout Standard
5184 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
5188 \begin_layout Enumerate
5189 Somebody is actively working on a fix.
5192 \begin_layout Enumerate
5193 The bug is so severe that it would block the release if it is not fixed.
5196 \begin_layout Standard
5197 If a bug is important, but nobody is working on it, and it is no showstopper,
5198 use a milestone like 2.1.x or 2.2.x.
5199 For all other bugs, do not set a milestone at all.
5202 \begin_layout Subsection
5203 Can we add rc entries in stable branch?
5206 \begin_layout Standard
5208 We are supposed to increase the prefs2prefs version number with such things.
5211 \begin_layout Section
5212 \begin_inset CommandInset label
5214 name "sec:Documentation-policies"
5218 Documentation policies
5221 \begin_layout Subsection
5225 \begin_layout Standard
5227 \begin_inset space ~
5230 rules in editing the docs:
5233 \begin_layout Enumerate
5234 \begin_inset CommandInset label
5236 name "enu:If-you-are"
5240 If you are not the maintainer of a doc file or a chapter/section, you MUST
5241 use change tracking so that the maintainer could review your changes
5244 \begin_layout Enumerate
5245 Respect the formatting of the document.
5246 The different files use different formatting styles.
5247 That is OK and has historic reasons nobody fully knows ;-).
5248 But it is important to be consistent within one file.
5251 \begin_layout Enumerate
5252 All changes you make to a file in one language MUST also go the file in
5253 the other actively maintained languages.
5254 Normally the maintainer does this for you, if you are the maintainer, you
5255 must do this by copying or changing the changed or added text to the other
5256 files so that the translators sees the blue underlined text and know what
5257 they have to translate and what was changed.
5260 \begin_layout Enumerate
5261 You MUST assure that the document is compilable as
5262 \begin_inset Quotes eld
5266 \begin_inset Quotes erd
5269 or the document's default output format after your changes.
5272 \begin_layout Enumerate
5273 All fixes (typos, compilation fixes, updates info etc.) go at first into
5274 the current GIT branch because the user should benefit from all fixes with
5275 every minor release.
5276 Feel free to commit directly to branch as long as you follow rule
5277 \begin_inset space ~
5281 \begin_inset CommandInset ref
5283 reference "enu:If-you-are"
5288 You can immediately commit to master as well.
5291 \begin_layout Enumerate
5292 \begin_inset CommandInset label
5294 name "enu:The-fileformat-of"
5298 The fileformat of a file must not be changed unless you document a new feature
5299 in LyX that requires a new fileformat.
5300 The reason for this rule is to keep it easy for the doc maintainers to
5301 port/backport changes to from master/branch.
5304 \begin_layout Standard
5305 The main documentation consists of these files:
5308 \begin_layout Description
5309 splash.lyx it is the first file you see after an installation.
5310 We assume that a new user sees this.
5311 It is therefore designed to be as simple as possible.
5312 Therefore please don't add any new formatting, only fix typos etc.
5313 Splash.lyx is up to date for \SpecialChar LyX
5314 2.1.x, currently maintained by Uwe Stöhr.
5317 \begin_layout Description
5318 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
5320 It therefore uses a limited set of formatting.
5321 For example a standard document class.
5322 Since new users will first learn about the formatting possibilities of
5324 please keep this file that simple.
5325 Intro.lyx is up to date for \SpecialChar LyX
5326 2.1.x, currently maintained by Uwe Stöhr.
5329 \begin_layout Description
5330 Tutorial.lyx our tutorial.
5331 It must be always up to date.
5332 Normally there is nothing to add since we don't want to overwhelm new users
5333 with too much details.
5334 The will learn these details while using \SpecialChar LyX
5335 and we have special manuals.
5336 Tutorial.lyx is up to date for \SpecialChar LyX
5337 2.1.x, currently maintained by Uwe Stöhr.
5340 \begin_layout Description
5341 UserGuide.lyx our main user guide.
5342 It covers a mixture of basic and detailed information.
5343 Some information is also in the Math and EmbeddedObjects manual so that
5344 the UserGuide refers to these files.
5345 UserGuide.lyx is up to date for \SpecialChar LyX
5346 2.1.x, currently maintained by Uwe Stöhr.
5349 \begin_layout Description
5350 EmbeddedObjects.lyx a special manual to explain things like tables floats
5353 EmbeddedObjects.lyx is up to date for \SpecialChar LyX
5354 2.1.x, currently maintained by Uwe
5358 \begin_layout Description
5359 Math.lyx a special manual to explain everything regarding math in all detail.
5360 Math.lyx is up to date for \SpecialChar LyX
5361 2.1.x, currently maintained by Uwe Stöhr.
5364 \begin_layout Description
5365 Additional.lyx this manual covers information that would be too much detail
5366 for the UserGuide or would make the UserGuide uncompilable or only compilable
5367 when installing a lot of special \SpecialChar LaTeX
5369 What should be in the UserGuide or better in Additional is a matter of
5371 it is up to you to decide that.
5372 Additional.lyx is not completely up to date for \SpecialChar LyX
5375 \begin_inset space ~
5378 8 is up to date and currently maintained by Uwe Stöhr.
5379 It certainly needs a rewrite and update.
5380 For example many info in chapter
5381 \begin_inset space ~
5384 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
5388 \begin_layout Description
5389 Customization.lyx this manual covers information how to customize \SpecialChar LyX
5391 output formats, operating systems, languages etc.
5392 It is currently completely out of date and needs a major rewrite and update.
5393 If you do this please assure that your information are given for all OSes
5394 and \SpecialChar LaTeX
5395 distributions (meaning be as objective as possible).