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 right-click on the project
2034 in the project explorer and chose
2041 \begin_layout Standard
2042 For convenience, these commands also produce re-exported roundtrip .lyx.tex
2044 Please examine the changed output carefully before committing the changed
2045 files to the repository: Since the test machinery does not do a roundtrip
2047 \begin_inset Formula $\Rightarrow$
2051 \begin_inset Formula $\Rightarrow$
2054 .tex, and does not compare the produced dvi or pdf output, it assumes that
2055 the stored .lyx reference produces correct output if processed by \SpecialChar LyX
2057 There is only one chance to detect wrong output: before committing a new
2059 Once it is committed, it is quite difficult to verify whether it is correct.
2062 \begin_layout Standard
2067 update the test references by opening them with \SpecialChar LyX
2068 or directly running lyx2lyx
2070 This would not work, since lyx2lyx and \SpecialChar LyX
2071 produce slightly different files
2072 regarding insignificant whitespace and line breaks.
2075 \begin_layout Subsubsection
2079 \begin_layout Standard
2080 In many cases tests for new features may be added to one of the existing
2081 test files, but sometimes this is not possible or not wanted.
2082 Then a new test file needs to be added:
2085 \begin_layout Enumerate
2087 \begin_inset Flex Code
2090 \begin_layout Plain Layout
2091 src/tex2lyx/test/<test name>.tex
2096 and run tex2lyx in roundtrip mode to produce the file
2097 \begin_inset Flex Code
2100 \begin_layout Plain Layout
2101 src/tex2lyx/test/<test name>.lyx.lyx
2107 This file will be the new reference.
2110 \begin_layout Enumerate
2111 Once you confirmed that the tex2lyx output is correct, add the new files
2112 to the corresponding lists in
2113 \begin_inset Flex Code
2116 \begin_layout Plain Layout
2117 src/tex2lyx/test/runtests.py
2123 \begin_inset Flex Code
2126 \begin_layout Plain Layout
2127 src/tex2lyx/Makefile.am
2133 \begin_inset Flex Code
2136 \begin_layout Plain Layout
2137 src/tex2lyx/test/CMakeLists.txt
2145 \begin_layout Enumerate
2146 Commit the changes to the repository, or send a patch to the development
2147 list and ask for committing if you do not have commit rights.
2150 \begin_layout Subsection
2151 ctest automatic tests
2154 \begin_layout Standard
2155 Some tests are located in the
2156 \begin_inset Flex Code
2159 \begin_layout Plain Layout
2160 development/autotests/
2165 subfolder of the \SpecialChar LyX
2166 source code distribution.
2171 \begin_layout Plain Layout
2172 The README document in this folder only describes the
2173 \begin_inset Quotes eld
2177 \begin_inset Quotes erd
2180 subset of autotests!
2188 \begin_layout Standard
2189 These tests can be run by the commands
2190 \begin_inset Flex Code
2193 \begin_layout Plain Layout
2203 (all platforms) or (when using a make based build system and not MSVC)
2205 \begin_inset Flex Code
2208 \begin_layout Plain Layout
2215 \begin_inset Flex Code
2218 \begin_layout Plain Layout
2229 The test logs are written to the
2230 \begin_inset Flex Code
2233 \begin_layout Plain Layout
2247 \begin_layout Subsubsection
2251 \begin_layout Standard
2252 The export tests are integration tests.
2253 They take longer to run and are more likely to break than the tex2lyx tests.
2254 Nevertheless, they have caught many regressions and without a better alternativ
2255 e it is important to keep them up-to-date and understand how they work.
2258 \begin_layout Standard
2260 \begin_inset Quotes eld
2264 \begin_inset Quotes erd
2267 documentation, template, and example documents.
2268 In addition, there are a number of dedicated sample documents in the
2269 \begin_inset Flex Code
2272 \begin_layout Plain Layout
2278 subfolder of the \SpecialChar LyX
2279 source code distribution.
2280 All samples are (after copying and eventual processing by scripts) exported
2281 to various output formats via the
2282 \begin_inset Flex Code
2285 \begin_layout Plain Layout
2291 command line option.
2292 The tests checks for errors reported by LyX.
2293 (However, error-free export is no guarantee for an error-free output document.)
2296 \begin_layout Paragraph
2297 \begin_inset CommandInset label
2299 name "par:when-to-run-an-export-test"
2303 Expectations of LyX developers
2306 \begin_layout Standard
2307 Because the export tests are integration tests and take a long time to run,
2308 LyX developers are rarely expected to run all of the tests.
2309 Here are some good practices to follow by developers:
2312 \begin_layout Itemize
2313 When making a non-trivial change to a .layout file, run the export and layout
2314 tests corresponding with that .layout file.
2317 \begin_layout Itemize
2318 When making non-trivial changes to a .lyx file, run the export tests correspondin
2319 g to that .lyx file.
2324 \begin_layout Plain Layout
2325 This rule is due to revision.
2329 \begin_layout Plain Layout
2330 There is an objection from the documentation maintainer that working on
2331 the documentation must not be complicated by having to consider non-standard
2335 \begin_layout Itemize
2336 successful compiling/testing an edited documentation file with pdflatex
2337 suffices to ensure it can be commited, not tests with other exports are
2341 \begin_layout Plain Layout
2342 If sudden failures with other exports due to “half-tested” documentation
2343 updates are a problem for the test maintainer, the test suite should use
2347 \begin_layout Itemize
2348 copied to a cache dir (autotests/samples/doc/, say) but not changed,
2351 \begin_layout Itemize
2352 updated regularely (but on a time chosen by the test suite maintainer) from
2353 the originals in lib/doc/
2356 \begin_layout Plain Layout
2360 \begin_layout Itemize
2361 no test will fail due to ongoing work on documentation,
2364 \begin_layout Itemize
2365 the documentation is still tested in full (with some delay),
2368 \begin_layout Itemize
2369 failures with non-default export can be examined and handled accordingly
2370 in one run with the cache update,
2373 \begin_layout Itemize
2374 “interesting failures” (like the nested-language+polyglossia problem in
2375 es/Customization can be separated and moved into dedicated test samples.
2383 \begin_layout Itemize
2384 When making non-trivial changes to LyX's \SpecialChar LaTeX
2386 touching the encoding code or package handling code that you expect will
2387 change the exported \SpecialChar LaTeX
2392 \begin_layout Standard
2393 \paragraph_spacing single
2394 Consider running all of the export tests before and after your change.
2395 If there are differences, please reconcile these (i.e.
2396 fix the bug or fix the tests)
2401 Ask for help if you're not sure what to.
2404 \begin_layout Standard
2405 If you do not want to run the tests,
2408 \begin_layout Itemize
2409 post the patch on the list and others will run the tests and eventually
2413 \begin_layout Itemize
2414 commit, but be prepared to fix eventually arising problems or to revert
2415 the commit if there is no easy fix.
2419 \begin_layout Itemize
2420 Understand how to interpret test failures.
2421 If your commit is found to have broken a test, you should be able to interpret
2422 the test results when made aware of them.
2424 \begin_inset CommandInset ref
2426 reference "subsec:Interpreting-export-tests"
2433 \begin_layout Paragraph
2434 \begin_inset CommandInset label
2436 name "par:export-test-output-formats"
2443 \begin_layout Standard
2444 The following output formats are currently tested for each sample document
2446 \begin_inset CommandInset ref
2448 reference "par:Export-test-filtering"
2455 \begin_layout Labeling
2456 \labelwidthstring 00.00.0000
2461 \begin_layout Labeling
2462 \labelwidthstring 00.00.0000
2463 lyx16 LyX 1.6 file format (lyx2lyx)
2466 \begin_layout Labeling
2467 \labelwidthstring 00.00.0000
2468 lyx21 LyX 2.1 file format (lyx2lyx)
2471 \begin_layout Labeling
2472 \labelwidthstring 00.00.0000
2473 xhtml LyXHTML (native LyX HTML export)
2477 \begin_layout Labeling
2478 \labelwidthstring 00.00.0000
2480 \begin_inset space ~
2484 \begin_inset space ~
2491 \begin_layout Labeling
2492 \labelwidthstring pdf5msystemFM
2493 dvi DVI (8-bit latex)
2496 \begin_layout Labeling
2497 \labelwidthstring pdf5msystemFM
2498 dvi3_texF DVI (LuaTeX with 8-bit TeX fonts)
2501 \begin_layout Labeling
2502 \labelwidthstring pdf5msystemFM
2503 dvi3_systemF DVI (LuaTeX with Unicode fonts)
2506 \begin_layout Labeling
2507 \labelwidthstring pdf5msystemFM
2511 \begin_layout Labeling
2512 \labelwidthstring pdf5msystemFM
2513 pdf4_texF PDF (XeTeX with 8-bit TeX fonts)
2516 \begin_layout Labeling
2517 \labelwidthstring pdf5msystemFM
2518 pdf4_systemF PDF (XeTeX with Unicode fonts)
2521 \begin_layout Labeling
2522 \labelwidthstring pdf5msystemFM
2523 pdf5_texF PDF (LuaTeX with 8-bit TeX fonts)
2526 \begin_layout Labeling
2527 \labelwidthstring pdf5msystemFM
2528 pdf5_systemF PDF (LuaTeX with Unicode fonts)
2532 \begin_layout Labeling
2533 \labelwidthstring 00.00.0000
2535 \begin_inset space ~
2539 \begin_inset space ~
2543 \begin_inset space ~
2547 \begin_inset space ~
2554 \begin_layout Labeling
2555 \labelwidthstring pdf5msystemFM
2556 pdf DVI -> PS (dvips) -> PDF (ps2pdf)
2559 \begin_layout Labeling
2560 \labelwidthstring pdf5msystemFM
2561 pdf3 DVI -> PDF (dvipdfm)
2565 \begin_layout Labeling
2566 \labelwidthstring 00.00.0000
2568 \begin_inset space ~
2571 tested: (or only if set as default output format in the document source)
2575 \begin_layout Labeling
2576 \labelwidthstring pdf5msystemFM
2580 \begin_layout Labeling
2581 \labelwidthstring pdf5msystemFM
2582 luatex LaTeX (LuaTeX)
2585 \begin_layout Labeling
2586 \labelwidthstring pdf5msystemFM
2587 dviluatex LaTeX (dviluatex)
2590 \begin_layout Labeling
2591 \labelwidthstring pdf5msystemFM
2592 pdflatex LaTeX (pdflatex)
2595 \begin_layout Labeling
2596 \labelwidthstring pdf5msystemFM
2597 platex LaTeX (pLaTeX)
2600 \begin_layout Labeling
2601 \labelwidthstring pdf5msystemFM
2605 \begin_layout Labeling
2606 \labelwidthstring pdf5msystemFM
2607 eps3 EPS (encapsulated Postscript) (cropped)
2610 \begin_layout Labeling
2611 \labelwidthstring pdf5msystemFM
2612 ps DVI -> Postscript (dvips)
2615 \begin_layout Labeling
2616 \labelwidthstring pdf5msystemFM
2620 \begin_layout Labeling
2621 \labelwidthstring pdf5msystemFM
2622 text (nor text2, ..., text4)
2625 \begin_layout Labeling
2626 \labelwidthstring pdf5msystemFM
2630 \begin_layout Labeling
2631 \labelwidthstring pdf5msystemFM
2635 \begin_layout Labeling
2636 \labelwidthstring pdf5msystemFM
2640 \begin_layout Labeling
2641 \labelwidthstring pdf5msystemFM
2646 \begin_layout Paragraph
2647 \begin_inset CommandInset label
2649 name "par:Configuring-ctests"
2653 Configuring the tests
2656 \begin_layout Standard
2657 To enable the export autotests, add the
2658 \begin_inset Flex Code
2661 \begin_layout Plain Layout
2662 -DLYX_ENABLE_EXPORT_TESTS=ON
2671 \begin_layout Standard
2672 \begin_inset Flex Code
2675 \begin_layout Plain Layout
2676 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
2684 \begin_layout Standard
2686 This flag will increase the time for the cmake command by several seconds,
2687 mainly because of the process of inverting tests (see Section
2688 \begin_inset CommandInset ref
2690 reference "subsec:Interpreting-export-tests"
2697 \begin_layout Paragraph
2698 \begin_inset CommandInset label
2700 name "par:ctest-options"
2707 \begin_layout Standard
2708 To run all tests, in the build directory simply run the command
2709 \begin_inset Flex Code
2712 \begin_layout Plain Layout
2719 A full, up-to-date TeXLive installation is recommended to run the tests.
2720 Otherwise, some tests will fail.
2721 Tests with additional requirements are labeled
2722 \begin_inset Quotes eld
2725 unreliable:nonstandard
2726 \begin_inset Quotes erd
2733 \begin_layout Standard
2734 To run only some of the tests, use command line options (see examples below):
2737 \begin_layout Labeling
2738 \labelwidthstring -R
2739 \begin_inset Flex Code
2742 \begin_layout Plain Layout
2748 Run only the tests whose names match the given regular expression.
2751 \begin_layout Labeling
2752 \labelwidthstring -R
2753 \begin_inset Flex Code
2756 \begin_layout Plain Layout
2762 Run only the tests whose labels match the given regular expression.
2763 A test may have more that one label.
2767 \begin_layout Labeling
2768 \labelwidthstring -R
2769 \begin_inset Flex Code
2772 \begin_layout Plain Layout
2778 Exclude the tests whose names match the given regular expression.
2781 \begin_layout Labeling
2782 \labelwidthstring -R
2783 \begin_inset Flex Code
2786 \begin_layout Plain Layout
2792 Exclude the tests whose labels match the given regular expression.
2793 Cannot be combined with
2794 \begin_inset Flex Code
2797 \begin_layout Plain Layout
2806 \begin_layout Standard
2807 The following options help to find good selection patterns:
2810 \begin_layout Labeling
2811 \labelwidthstring -R
2812 \begin_inset Flex Code
2815 \begin_layout Plain Layout
2821 List the tests that would be run but not actually run them.
2826 \begin_layout Standard
2827 Useful in conjunction with the -R, -L, -E and -LE options, e.g., if you want
2828 to know how many tests there are or whether your
2829 \begin_inset Flex Code
2832 \begin_layout Plain Layout
2838 regular expression did what you expected.
2842 \begin_layout Labeling
2843 \labelwidthstring -R
2844 \begin_inset Flex Code
2847 \begin_layout Plain Layout
2848 \SpecialChar nobreakdash
2849 \SpecialChar nobreakdash
2855 print the list of all labels associated with the test set.
2856 Can also be combined with -R, -L, -E, ...
2860 \begin_layout Standard
2861 Other useful options are:
2864 \begin_layout Labeling
2865 \labelwidthstring -R
2866 \begin_inset Flex Code
2869 \begin_layout Plain Layout
2875 Run the tests in parallel using the given number of jobs.
2879 \begin_layout Standard
2880 We are still working on getting the tests to run in parallel.
2881 However, when running the tests in parallel, sometimes tests fail that
2882 pass when run sequentially.
2883 A reasonable approach is to first run the tests in parallel and then run
2884 the failed tests sequentially.
2887 \begin_layout Standard
2888 For example, to run 8 jobs at a time:
2891 \begin_layout Standard
2892 \begin_inset Flex Code
2895 \begin_layout Plain Layout
2904 \begin_layout Standard
2905 \begin_inset Flex Code
2908 \begin_layout Plain Layout
2909 ctest \SpecialChar nobreakdash
2910 \SpecialChar nobreakdash
2919 \begin_layout Standard
2920 When specifying a subset of the tests (e.g.
2922 \begin_inset Flex Code
2925 \begin_layout Plain Layout
2926 \SpecialChar nobreakdash
2932 ), the same subset must be specified when using the
2933 \begin_inset Flex Code
2936 \begin_layout Plain Layout
2937 \SpecialChar nobreakdash
2938 \SpecialChar nobreakdash
2944 option because it is the test numbers that are used to index which tests
2945 failed on the previous run.
2948 \begin_layout Standard
2950 Note that some tests cannot be run in parallel.
2951 These tests are marked in the code with the
2952 \begin_inset Flex Code
2955 \begin_layout Plain Layout
2966 \begin_layout Labeling
2967 \labelwidthstring -R
2968 \begin_inset Flex Code
2971 \begin_layout Plain Layout
2972 \SpecialChar nobreakdash
2973 \SpecialChar nobreakdash
2979 Set a global timeout on all tests that do not already have a timeout set
2984 \begin_layout Standard
2985 There have been bugs in LyX and in \SpecialChar LaTeX
2986 which cause compilation to hang, and
2987 without a timeout a test might never stop (in one case there was even a
2989 If a test times out, the
2990 \begin_inset Flex Code
2993 \begin_layout Plain Layout
2999 command exits with error, but you can distinguish between a timed out test
3000 and a failed test in the output reported at the end of the
3001 \begin_inset Flex Code
3004 \begin_layout Plain Layout
3014 \begin_layout Standard
3016 \begin_inset Flex Code
3019 \begin_layout Plain Layout
3025 ) the full list of command line options.
3028 \begin_layout Paragraph
3032 \begin_layout Itemize
3033 run only the export tests:
3034 \begin_inset Flex Code
3037 \begin_layout Plain Layout
3046 \begin_layout Itemize
3048 \begin_inset Flex Code
3051 \begin_layout Plain Layout
3052 ctest -L "inverted|suspended"
3060 \begin_layout Itemize
3061 list all export tests which match any of the labelling patterns:
3062 \begin_inset Flex Code
3065 \begin_layout Plain Layout
3076 \begin_layout Itemize
3077 exclude rarely used output formats and post-processing tests
3078 \begin_inset Flex Code
3081 \begin_layout Plain Layout
3082 ctest -L export -E "_(texF|dvi3|pdf3?)"
3090 \begin_layout Paragraph
3091 \begin_inset CommandInset label
3093 name "subsec:Interpreting-export-tests"
3097 Interpreting the export test results
3100 \begin_layout Standard
3101 A test can fail for several reasons, not all of them bad.
3104 \begin_layout Enumerate
3105 A new or edited sample document may be incompatible with some output formats.
3108 \begin_layout Enumerate
3109 A dependency is not met (e.g.
3110 the \SpecialChar LaTeX
3112 One hint that this is the case is that the corresponding
3113 \begin_inset Flex Code
3116 \begin_layout Plain Layout
3122 test will likely also fail.
3125 \begin_layout Enumerate
3126 An inverted test fails to fail (i.e.
3127 export that previously failed now works).
3130 \begin_layout Enumerate
3131 An external dependency was updated (e.g.
3136 \begin_layout Enumerate
3137 A recent code change introduced a bug.
3140 \begin_layout Enumerate
3141 \begin_inset CommandInset label
3147 A change in a document exposed a previously unknown bug or an incompatibility
3148 with an export format (e.g.
3149 Lua\SpecialChar LaTeX
3153 \begin_layout Standard
3154 Because the .lyx files are exported in several formats, it is not surprising
3155 that many of the exports fail.
3156 This expectation of failure is addressed by
3157 \begin_inset Quotes eld
3161 \begin_inset Quotes erd
3164 the tests, that is, by marking the test as
3165 \begin_inset Quotes eld
3169 \begin_inset Quotes erd
3172 if the export exits with error and as
3173 \begin_inset Quotes eld
3177 \begin_inset Quotes erd
3180 if the export succeeds
3185 It follows that these expected failures will not show up as failed tests
3186 in the test results and thus will not pollute the
3187 \begin_inset Quotes eld
3191 \begin_inset Quotes erd
3195 If the export actually succeeds, then the test will fail.
3196 The purpose of this failure is to get your attention—something has changed,
3197 possibly for the better.
3200 \begin_layout Standard
3201 We try to document why a test is inverted or ignored.
3202 See the comment (prefixed with
3203 \begin_inset Flex Code
3206 \begin_layout Plain Layout
3212 ) above the block in which the test is listed as inverted or ignored in
3214 \begin_inset Flex Code
3217 \begin_layout Plain Layout
3218 development/autotests/invertedTests
3224 \begin_inset Flex Code
3227 \begin_layout Plain Layout
3228 development/autotests/unreliableTests
3234 \begin_inset Flex Code
3237 \begin_layout Plain Layout
3238 development/autotests/ignoredTests
3247 \begin_layout Standard
3248 A good question is why do we enable the tests for non-default formats? The
3249 answer is that if a non-default route is broken it is often because a bug
3250 was introduced in LyX and not because a document-specific change was made
3251 that is not supported by the route.
3252 In other words, there is a high signal/noise ratio in the export tests
3253 for some non-default formats.
3257 \begin_layout Standard
3258 When a test or several tests fail, consider checking the files in the
3259 \begin_inset Flex Code
3262 \begin_layout Plain Layout
3268 subdirectory of your build directory.
3269 In this subdirectory are three files: the file
3270 \begin_inset Flex Code
3273 \begin_layout Plain Layout
3279 simply lists the tests that failed on your last
3280 \begin_inset Flex Code
3283 \begin_layout Plain Layout
3290 \begin_inset Flex Code
3293 \begin_layout Plain Layout
3299 file contains the output from the tests (and often has details explaining
3300 why a test failed); and the
3301 \begin_inset Flex Code
3304 \begin_layout Plain Layout
3310 file lists the times that it took to run the tests.
3313 \begin_layout Paragraph
3314 What action should you take if a test fails?
3317 \begin_layout Standard
3318 \paragraph_spacing single
3319 It is always good to check manually why something fails and if it passes
3320 if the PDF output is good.
3323 \begin_layout Itemize
3324 Generally, if a change breaks compilation for the target format (for the
3325 manuals pdf2) without solving some important other issue,
3327 fix or revert the commit
3329 that led to failure.
3332 \begin_layout Itemize
3333 If it is not possible to (immediately) fix the failure but there are reasons
3334 not to revert the commit (e.g.
3335 it fixes another more important issue),
3339 the failing test case (see
3340 \begin_inset CommandInset ref
3342 reference "par:Inverted-tests"
3349 \begin_layout Itemize
3354 test case fails because the export now works,
3358 the test by removing the pattern from the
3359 \begin_inset Quotes eld
3363 \begin_inset Quotes erd
3367 \begin_inset CommandInset ref
3369 reference "par:Inverted-tests"
3376 \begin_layout Itemize
3377 If the export did not fail previously but led to wrong output (PDF, say),
3381 \begin_layout Plain Layout
3382 Non-failing test with wrong output should be labeledas
3383 \begin_inset Quotes eld
3386 unreliable:wrong_output
3387 \begin_inset Quotes erd
3391 \begin_inset CommandInset ref
3393 reference "par:Unreliable-tests"
3402 it is in fact an improvement when the test now fails.
3407 the failing test case (see
3408 \begin_inset CommandInset ref
3410 reference "par:Inverted-tests"
3417 \begin_layout Itemize
3418 In case of tests failing due to missing requirements (tests labeled
3419 \begin_inset Quotes eld
3422 unreliable:nonstandard
3423 \begin_inset Quotes erd
3426 or testing on a system with only a subset of TeXLive installed), ignore
3427 the failure, ask for someone else to run the test, or install the missing
3428 resources and try again.
3431 \begin_layout Itemize
3432 Check the log file Testing/Temporary/LastTest.log.
3433 In case of latex-errors rerun the failing test with environment variable
3434 'LAX_DEBUG_LATEX' set to '1'.
3435 This will include latex messages in LastTest.log, so it should be easier
3436 to interpret the fail-reason.
3439 \begin_layout Paragraph
3440 \begin_inset CommandInset label
3442 name "par:Inverted-tests"
3449 \begin_layout Standard
3450 Test cases whose name matches a pattern in the file
3451 \begin_inset Flex Code
3454 \begin_layout Plain Layout
3455 development/autotests/invertedTests
3465 They get also the test property
3466 \begin_inset Flex Code
3469 \begin_layout Plain Layout
3476 they are reported as failing if the export works without error
3477 \begin_inset Flex URL
3480 \begin_layout Plain Layout
3482 https://cmake.org/cmake/help/v3.0/command/set_tests_properties.html
3490 \begin_layout Standard
3491 Add failing cases to this file, if they cannot be solved
3492 \begin_inset Quotes eld
3496 \begin_inset Quotes erd
3499 but it is expected that the export will work in a foreseeable future, e.g.
3500 low priority issues like failures to export to a non-target format (for
3501 the manuals everything except pdf2).
3504 \begin_layout Standard
3505 The following sublabels are currently present in
3506 \begin_inset Flex Code
3509 \begin_layout Plain Layout
3518 \begin_layout Description
3519 todo test failures that require attention:
3523 \begin_layout Itemize
3524 minor issues to explore and properly sort later,
3527 \begin_layout Itemize
3531 \begin_layout Itemize
3532 LyX bugs to report at trac (move pattern to section "lyxbugs" once done).
3536 \begin_layout Description
3537 lyxbugs LyX bugs with a Trac number.
3540 \begin_layout Description
3541 ert Export failures due to "raw" LaTeX use in ERT or preamble code.
3545 \begin_layout Standard
3546 "Wontfix" if demonstrating correct use and OK in the default output format.
3550 \begin_layout Description
3551 texissues Export fails due to LaTeX limitations like non-ASCII characters
3552 in verbatim or listings, incompatible packages, ...
3556 \begin_layout Standard
3557 "Wontfix" if documents demonstrate correct use in the default output format:
3560 \begin_layout Itemize
3561 If the source can be made more robust without becoming "hackish", fix the
3565 \begin_layout Itemize
3566 if LyX could be enhanced to care for a permanent TeX limitation, file a
3567 ticket at trac and add a pattern under lyxbugs,
3570 \begin_layout Itemize
3571 otherwise, add a pattern here.
3575 \begin_layout Description
3576 attic Documents in the attic (kept for reference and format conversion test).
3578 \begin_inset Quotes eld
3582 \begin_inset Quotes erd
3588 \begin_layout Subparagraph
3592 \begin_layout Standard
3593 Test cases whose name additionally matches a pattern in the file
3594 \begin_inset Flex Code
3597 \begin_layout Plain Layout
3598 development/autotests/suspendedTests
3616 This means they are not executed using
3617 \begin_inset Flex Code
3620 \begin_layout Plain Layout
3627 \begin_inset Flex Code
3630 \begin_layout Plain Layout
3637 However, they also get the test property
3638 \begin_inset Flex Code
3641 \begin_layout Plain Layout
3648 they are reported as failing if the export works without error.
3649 From time to time they still have to be checked using
3650 \begin_inset Flex Code
3653 \begin_layout Plain Layout
3662 \begin_layout Standard
3663 These tests are suspended, because the export fails for known reasons which
3664 cannot ATM be resolved.
3665 But it is expected the reason might disappear in the future.
3666 Be it new TL or better handling in \SpecialChar LyX
3670 \begin_layout Standard
3671 For ctest commands without the
3672 \begin_inset Flex Code
3675 \begin_layout Plain Layout
3681 parameter nothing changes.
3682 Suspended or not, tests will be executed depending only on the selecting
3683 regular expression given to the ctest command (see
3684 \begin_inset CommandInset ref
3686 reference "par:ctest-options"
3693 \begin_layout Paragraph
3694 \begin_inset CommandInset label
3696 name "par:Unreliable-tests"
3703 \begin_layout Standard
3704 Test cases whose name matches a pattern in the file
3705 \begin_inset Flex Code
3708 \begin_layout Plain Layout
3709 development/autotests/unreliableTests
3721 \begin_layout Standard
3722 These tests are not executed using
3723 \begin_inset Flex Code
3726 \begin_layout Plain Layout
3733 \begin_inset Flex Code
3736 \begin_layout Plain Layout
3746 \begin_layout Standard
3747 They pass or fail for various reasons not related to LyX (nonstandard, erratic)
3748 or pass but should rather fail (wrong output).
3750 \begin_inset Note Note
3753 \begin_layout Plain Layout
3754 *invalid* tests (wrong output) are not *unreliable*.
3755 # Use "unfit" or "unapplicable" as better label and name of pattern file?
3764 \begin_layout Standard
3765 The following sublabels are currently present in
3766 \begin_inset Flex Code
3769 \begin_layout Plain Layout
3778 \begin_layout Description
3779 nonstandard Documents with additional requirements, e.g.
3780 a class or package file not in TeXLive.
3782 \begin_inset Note Note
3785 \begin_layout Plain Layout
3787 \begin_inset Quotes eld
3791 \begin_inset Quotes erd
3795 \begin_inset Quotes eld
3799 \begin_inset Quotes erd
3810 \begin_layout Description
3811 erratic Tests depending on local configuration or the phase of the moon.
3815 \begin_layout Description
3816 varying_versions Test depending on TeX distribution, package versions or
3820 \begin_layout Description
3822 \begin_inset space ~
3825 output Export does not fail but the resulting document has (undetected)
3830 \begin_layout Standard
3831 \paragraph_spacing single
3832 \begin_inset Note Note
3835 \begin_layout Plain Layout
3836 \paragraph_spacing single
3837 These tests are in a strict sense not unreliable but
3841 (not measuring what they should measure).
3850 \begin_layout Paragraph
3851 \begin_inset CommandInset label
3853 name "par:Export-test-filtering"
3857 Export test filtering
3860 \begin_layout Standard
3861 The assignment of a label to a test is controlled by a set of files with
3862 regular expressions that are matched against the test names.
3865 \begin_layout Description
3866 ignoredTests (small file)
3867 \begin_inset Newline newline
3870 Tests selected here are withdrawn in the configuration step (cf.
3872 \begin_inset CommandInset ref
3874 reference "par:Configuring-ctests"
3882 \begin_layout Labeling
3883 \labelwidthstring 00.00.0000
3884 Input Test of any export combination
3887 \begin_layout Labeling
3888 \labelwidthstring 00.00.0000
3889 Output Stop if tests not selected here
3893 \begin_layout Description
3894 unreliableTests: Tests selected pass or fail dependent on the system where
3896 Selected tests gain the label 'unreliable'.
3900 \begin_layout Labeling
3901 \labelwidthstring 00.00.0000
3902 Input Each test which passed 'ignoredTests'
3905 \begin_layout Labeling
3906 \labelwidthstring 00.00.0000
3907 Output Stop if test selected, gain label 'unreliable'.
3911 \begin_layout Description
3913 \begin_inset space \space{}
3920 \begin_layout Labeling
3921 \labelwidthstring 00.00.0000
3922 Input Each test which passed 'unreliableTests'
3925 \begin_layout Labeling
3926 \labelwidthstring 00.00.0000
3927 Output Stop if not selected, gain test-property 'WILL_FAIL' (i.e.
3928 tests are reported as failing if the export works without error.) If no
3929 subselection applies, gain labels 'export' and 'inverted'.
3932 \begin_layout Standard
3933 The following filter perfoms a subselection of 'invertedTests':
3936 \begin_layout Description
3937 suspendedTests Tests selected here gain the label 'suspended' but _not_
3938 'export' or 'inverted', although in ctest they remain inverted.
3939 ('ctest' knows only 'inverted' or not, labels are used only for test selection)
3943 \begin_layout Labeling
3944 \labelwidthstring 00.00.0000
3945 Input Each test selected by 'invertedTests'
3948 \begin_layout Labeling
3949 \labelwidthstring 00.00.0000
3950 Output Selected test gains label 'suspended'.
3956 \begin_layout Standard
3957 The following table may clarify label assignement
3960 \begin_layout Standard
3961 \begin_inset Tabular
3962 <lyxtabular version="3" rows="7" columns="9">
3963 <features tabularvalignment="middle">
3964 <column alignment="left" valignment="top" width="0pt">
3965 <column alignment="left" valignment="top" width="0pt">
3966 <column alignment="left" valignment="top" width="0pt">
3967 <column alignment="left" valignment="top" width="0pt">
3968 <column alignment="center" valignment="top">
3969 <column alignment="center" valignment="top">
3970 <column alignment="center" valignment="top">
3971 <column alignment="center" valignment="top">
3972 <column alignment="center" valignment="top">
3974 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3977 \begin_layout Plain Layout
3978 Test matching pattern in file:
3983 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3986 \begin_layout Plain Layout
3992 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3995 \begin_layout Plain Layout
4001 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4004 \begin_layout Plain Layout
4010 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4013 \begin_layout Plain Layout
4019 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4022 \begin_layout Plain Layout
4028 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4031 \begin_layout Plain Layout
4037 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4040 \begin_layout Plain Layout
4046 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4049 \begin_layout Plain Layout
4057 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4060 \begin_layout Plain Layout
4066 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4069 \begin_layout Plain Layout
4075 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4078 \begin_layout Plain Layout
4084 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4087 \begin_layout Plain Layout
4093 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4096 \begin_layout Plain Layout
4102 <cell alignment="center" valignment="top" topline="true" usebox="none">
4105 \begin_layout Plain Layout
4111 <cell alignment="center" valignment="top" topline="true" usebox="none">
4114 \begin_layout Plain Layout
4120 <cell alignment="center" valignment="top" topline="true" usebox="none">
4123 \begin_layout Plain Layout
4129 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4132 \begin_layout Plain Layout
4140 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4143 \begin_layout Plain Layout
4149 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4152 \begin_layout Plain Layout
4158 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4161 \begin_layout Plain Layout
4167 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4170 \begin_layout Plain Layout
4176 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4179 \begin_layout Plain Layout
4185 <cell alignment="center" valignment="top" topline="true" usebox="none">
4188 \begin_layout Plain Layout
4194 <cell alignment="center" valignment="top" topline="true" usebox="none">
4197 \begin_layout Plain Layout
4203 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4206 \begin_layout Plain Layout
4212 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4215 \begin_layout Plain Layout
4223 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4226 \begin_layout Plain Layout
4232 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4235 \begin_layout Plain Layout
4241 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4244 \begin_layout Plain Layout
4250 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4253 \begin_layout Plain Layout
4259 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4262 \begin_layout Plain Layout
4268 <cell alignment="center" valignment="top" topline="true" usebox="none">
4271 \begin_layout Plain Layout
4277 <cell alignment="center" valignment="top" topline="true" usebox="none">
4280 \begin_layout Plain Layout
4286 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4289 \begin_layout Plain Layout
4295 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4298 \begin_layout Plain Layout
4306 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
4309 \begin_layout Plain Layout
4315 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4318 \begin_layout Plain Layout
4324 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4327 \begin_layout Plain Layout
4333 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4336 \begin_layout Plain Layout
4342 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4345 \begin_layout Plain Layout
4351 <cell alignment="center" valignment="top" topline="true" usebox="none">
4354 \begin_layout Plain Layout
4360 <cell alignment="center" valignment="top" topline="true" usebox="none">
4363 \begin_layout Plain Layout
4369 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4372 \begin_layout Plain Layout
4378 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4381 \begin_layout Plain Layout
4389 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4392 \begin_layout Plain Layout
4398 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4401 \begin_layout Plain Layout
4407 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4410 \begin_layout Plain Layout
4416 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4419 \begin_layout Plain Layout
4425 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4428 \begin_layout Plain Layout
4434 <cell alignment="center" valignment="top" topline="true" usebox="none">
4437 \begin_layout Plain Layout
4443 <cell alignment="center" valignment="top" topline="true" usebox="none">
4446 \begin_layout Plain Layout
4452 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4455 \begin_layout Plain Layout
4461 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4464 \begin_layout Plain Layout
4472 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4475 \begin_layout Plain Layout
4481 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4484 \begin_layout Plain Layout
4490 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4493 \begin_layout Plain Layout
4499 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4502 \begin_layout Plain Layout
4508 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4511 \begin_layout Plain Layout
4517 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4520 \begin_layout Plain Layout
4526 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4529 \begin_layout Plain Layout
4535 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4538 \begin_layout Plain Layout
4544 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4547 \begin_layout Plain Layout
4561 \begin_layout Standard
4562 \begin_inset Note Note
4565 \begin_layout Plain Layout
4567 \begin_inset Quotes eld
4571 \begin_inset Quotes erd
4574 filter, this would be far less complicated:
4577 \begin_layout Plain Layout
4578 \begin_inset Tabular
4579 <lyxtabular version="3" rows="6" columns="7">
4580 <features tabularvalignment="middle">
4581 <column alignment="left" valignment="top" width="0pt">
4582 <column alignment="left" valignment="top" width="0pt">
4583 <column alignment="left" valignment="top" width="0pt">
4584 <column alignment="center" valignment="top">
4585 <column alignment="center" valignment="top">
4586 <column alignment="center" valignment="top">
4587 <column alignment="center" valignment="top">
4589 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4592 \begin_layout Plain Layout
4593 Test matching pattern in file:
4598 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4601 \begin_layout Plain Layout
4607 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4610 \begin_layout Plain Layout
4616 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4619 \begin_layout Plain Layout
4625 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4628 \begin_layout Plain Layout
4634 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4637 \begin_layout Plain Layout
4643 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4646 \begin_layout Plain Layout
4654 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4657 \begin_layout Plain Layout
4663 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4666 \begin_layout Plain Layout
4672 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4675 \begin_layout Plain Layout
4681 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4684 \begin_layout Plain Layout
4690 <cell alignment="center" valignment="top" topline="true" usebox="none">
4693 \begin_layout Plain Layout
4699 <cell alignment="center" valignment="top" topline="true" usebox="none">
4702 \begin_layout Plain Layout
4708 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4711 \begin_layout Plain Layout
4719 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4722 \begin_layout Plain Layout
4728 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4731 \begin_layout Plain Layout
4737 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4740 \begin_layout Plain Layout
4746 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4749 \begin_layout Plain Layout
4755 <cell alignment="center" valignment="top" topline="true" usebox="none">
4758 \begin_layout Plain Layout
4764 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4767 \begin_layout Plain Layout
4773 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4776 \begin_layout Plain Layout
4784 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4787 \begin_layout Plain Layout
4793 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4796 \begin_layout Plain Layout
4802 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4805 \begin_layout Plain Layout
4811 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4814 \begin_layout Plain Layout
4820 <cell alignment="center" valignment="top" topline="true" usebox="none">
4823 \begin_layout Plain Layout
4829 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4832 \begin_layout Plain Layout
4838 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4841 \begin_layout Plain Layout
4849 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
4852 \begin_layout Plain Layout
4858 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4861 \begin_layout Plain Layout
4867 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4870 \begin_layout Plain Layout
4876 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4879 \begin_layout Plain Layout
4885 <cell alignment="center" valignment="top" topline="true" usebox="none">
4888 \begin_layout Plain Layout
4894 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4897 \begin_layout Plain Layout
4903 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4906 \begin_layout Plain Layout
4914 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4917 \begin_layout Plain Layout
4923 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4926 \begin_layout Plain Layout
4932 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4935 \begin_layout Plain Layout
4941 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4944 \begin_layout Plain Layout
4950 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4953 \begin_layout Plain Layout
4959 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4962 \begin_layout Plain Layout
4968 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4971 \begin_layout Plain Layout
4990 \begin_layout Subsubsection
4994 \begin_layout Standard
4995 These tests check whether a .lyx file loads without any terminal messages.
4996 They correspond to the manual operations of simply opening a .lyx file on
4997 the terminal, exiting LyX once the file is loaded, and then checking whether
4998 there is any output from the terminal.
4999 These tests are useful for catching malformed .lyx files and parsing bugs.
5000 They can also be used to find a .lyx file in which an instance of something
5002 To do this, compile LyX with a local patch that outputs something to the
5003 terminal when an instance is found, and then run the check_load tests to
5004 see if any fail, which would mean that the situation occurs in the LyX
5005 documentation files corresponding to the failed tests.
5006 These tests are expectedly fragile: any LyX diagnostic message, which is
5007 not necessarily an error, would cause the tests to fail.
5008 Similarly, any message output by a library (e.g.
5009 Qt) would also cause failure.
5010 There are some messages that the check_load tests are instructed to ignore,
5011 which are stored in the file
5012 \begin_inset Flex Code
5015 \begin_layout Plain Layout
5016 development/autotests/filterCheckWarnings
5024 \begin_layout Standard
5025 Under cmake, the tests are labeled as 'load'.
5028 \begin_layout Subsubsection
5032 \begin_layout Standard
5033 Automated tests based on the "MonKey Testing" keytest program are enabled
5034 if the necessary dependencies are found and if the CMake flag
5035 \begin_inset Flex Code
5038 \begin_layout Plain Layout
5039 -DLYX_ENABLE_KEYTESTS=ON
5045 They are documented in the README document in
5046 \begin_inset Flex Code
5049 \begin_layout Plain Layout
5050 development/autotests
5055 subfolder of the \SpecialChar LyX
5056 source code distribution.
5059 \begin_layout Subsubsection
5063 \begin_layout Standard
5064 These tests combine lyx2lyx tests with check_load tests.
5065 They fail if either fails.
5068 \begin_layout Subsubsection
5072 \begin_layout Standard
5073 The URL tests are enabled with the
5074 \begin_inset Flex Code
5077 \begin_layout Plain Layout
5078 -DLYX_ENABLE_URLTESTS=ON
5083 CMake flag and are useful for finding broken links in our documentation
5085 If a URL test fails, to see which link in particular was reported as broken,
5087 \begin_inset Flex Code
5090 \begin_layout Plain Layout
5097 These tests are extremely fragile (e.g.
5098 a test can depend on your Internet connection) and a failed URL test should
5099 not be taken too seriously.
5100 URL tests are labeled as
5105 \begin_layout Paragraph
5109 \begin_layout Standard
5110 cmake is required to run the \SpecialChar LyX
5111 tests, running them is not implemented for
5115 \begin_layout Standard
5116 The appropriate commands are:
5119 \begin_layout Itemize
5125 \begin_inset Newline newline
5128 runs all tests with label
5133 \begin_layout Itemize
5136 ctest -R 'check_.*urls'
5139 \begin_inset Newline newline
5142 runs the tests 'check_accessible_urls'
5145 \begin_layout Standard
5146 Associated test results can be examined in ctest-log directory in files
5147 of the form 'LastFailed.*URLS.log'
5150 \begin_layout Section
5151 Development policies
5154 \begin_layout Standard
5155 This chapter lists some guidelines that should be followed.
5156 This list is not complete, and many guidelines are in separate chapters,
5158 \begin_inset Quotes eld
5161 When is an update of the .lyx file format number needed?
5162 \begin_inset Quotes erd
5166 \begin_inset CommandInset ref
5168 reference "sec:When-is-an"
5175 \begin_layout Subsection
5176 When to set a fixed milestone?
5179 \begin_layout Standard
5180 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
5184 \begin_layout Enumerate
5185 Somebody is actively working on a fix.
5188 \begin_layout Enumerate
5189 The bug is so severe that it would block the release if it is not fixed.
5192 \begin_layout Standard
5193 If a bug is important, but nobody is working on it, and it is no showstopper,
5194 use a milestone like 2.1.x or 2.2.x.
5195 For all other bugs, do not set a milestone at all.
5198 \begin_layout Subsection
5199 Can we add rc entries in stable branch?
5202 \begin_layout Standard
5204 We are supposed to increase the prefs2prefs version number with such things.
5207 \begin_layout Section
5208 \begin_inset CommandInset label
5210 name "sec:Documentation-policies"
5214 Documentation policies
5217 \begin_layout Subsection
5221 \begin_layout Standard
5223 \begin_inset space ~
5226 rules in editing the docs:
5229 \begin_layout Enumerate
5230 \begin_inset CommandInset label
5232 name "enu:If-you-are"
5236 If you are not the maintainer of a doc file or a chapter/section, you MUST
5237 use change tracking so that the maintainer could review your changes
5240 \begin_layout Enumerate
5241 Respect the formatting of the document.
5242 The different files use different formatting styles.
5243 That is OK and has historic reasons nobody fully knows ;-).
5244 But it is important to be consistent within one file.
5247 \begin_layout Enumerate
5248 All changes you make to a file in one language MUST also go the file in
5249 the other actively maintained languages.
5250 Normally the maintainer does this for you, if you are the maintainer, you
5251 must do this by copying or changing the changed or added text to the other
5252 files so that the translators sees the blue underlined text and know what
5253 they have to translate and what was changed.
5256 \begin_layout Enumerate
5257 You MUST assure that the document is compilable as
5258 \begin_inset Quotes eld
5262 \begin_inset Quotes erd
5265 or the document's default output format after your changes.
5268 \begin_layout Enumerate
5269 All fixes (typos, compilation fixes, updates info etc.) go at first into
5270 the current GIT branch because the user should benefit from all fixes with
5271 every minor release.
5272 Feel free to commit directly to branch as long as you follow rule
5273 \begin_inset space ~
5277 \begin_inset CommandInset ref
5279 reference "enu:If-you-are"
5284 You can immediately commit to master as well.
5287 \begin_layout Enumerate
5288 \begin_inset CommandInset label
5290 name "enu:The-fileformat-of"
5294 The fileformat of a file must not be changed unless you document a new feature
5295 in LyX that requires a new fileformat.
5296 The reason for this rule is to keep it easy for the doc maintainers to
5297 port/backport changes to from master/branch.
5300 \begin_layout Standard
5301 The main documentation consists of these files:
5304 \begin_layout Description
5305 splash.lyx it is the first file you see after an installation.
5306 We assume that a new user sees this.
5307 It is therefore designed to be as simple as possible.
5308 Therefore please don't add any new formatting, only fix typos etc.
5309 Splash.lyx is up to date for \SpecialChar LyX
5310 2.1.x, currently maintained by Uwe Stöhr.
5313 \begin_layout Description
5314 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
5316 It therefore uses a limited set of formatting.
5317 For example a standard document class.
5318 Since new users will first learn about the formatting possibilities of
5320 please keep this file that simple.
5321 Intro.lyx is up to date for \SpecialChar LyX
5322 2.1.x, currently maintained by Uwe Stöhr.
5325 \begin_layout Description
5326 Tutorial.lyx our tutorial.
5327 It must be always up to date.
5328 Normally there is nothing to add since we don't want to overwhelm new users
5329 with too much details.
5330 The will learn these details while using \SpecialChar LyX
5331 and we have special manuals.
5332 Tutorial.lyx is up to date for \SpecialChar LyX
5333 2.1.x, currently maintained by Uwe Stöhr.
5336 \begin_layout Description
5337 UserGuide.lyx our main user guide.
5338 It covers a mixture of basic and detailed information.
5339 Some information is also in the Math and EmbeddedObjects manual so that
5340 the UserGuide refers to these files.
5341 UserGuide.lyx is up to date for \SpecialChar LyX
5342 2.1.x, currently maintained by Uwe Stöhr.
5345 \begin_layout Description
5346 EmbeddedObjects.lyx a special manual to explain things like tables floats
5349 EmbeddedObjects.lyx is up to date for \SpecialChar LyX
5350 2.1.x, currently maintained by Uwe
5354 \begin_layout Description
5355 Math.lyx a special manual to explain everything regarding math in all detail.
5356 Math.lyx is up to date for \SpecialChar LyX
5357 2.1.x, currently maintained by Uwe Stöhr.
5360 \begin_layout Description
5361 Additional.lyx this manual covers information that would be too much detail
5362 for the UserGuide or would make the UserGuide uncompilable or only compilable
5363 when installing a lot of special \SpecialChar LaTeX
5365 What should be in the UserGuide or better in Additional is a matter of
5367 it is up to you to decide that.
5368 Additional.lyx is not completely up to date for \SpecialChar LyX
5371 \begin_inset space ~
5374 8 is up to date and currently maintained by Uwe Stöhr.
5375 It certainly needs a rewrite and update.
5376 For example many info in chapter
5377 \begin_inset space ~
5380 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
5384 \begin_layout Description
5385 Customization.lyx this manual covers information how to customize \SpecialChar LyX
5387 output formats, operating systems, languages etc.
5388 It is currently completely out of date and needs a major rewrite and update.
5389 If you do this please assure that your information are given for all OSes
5390 and \SpecialChar LaTeX
5391 distributions (meaning be as objective as possible).