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 true
89 \author 34634807 "Jean-Pierre"
95 Developing \SpecialChar LyX
99 \begin_layout Subtitle
104 by the \SpecialChar LyX
109 \begin_layout Plain Layout
111 If you have comments or error corrections, please send them to the \SpecialChar LyX
114 \begin_inset Flex Code
117 \begin_layout Plain Layout
119 <lyx-docs@lists.lyx.org>
132 \begin_layout Standard
133 \begin_inset CommandInset toc
134 LatexCommand tableofcontents
141 \begin_layout Section
145 \begin_layout Standard
146 This manual documents some aspects of \SpecialChar LyX
148 It is currently rather incomplete, but will hopefully be extended in the
150 Meanwhile, additional information can be found in the
151 \begin_inset Flex Code
154 \begin_layout Plain Layout
160 subfolder of the \SpecialChar LyX
161 source code distribution.
162 This document is not translated, since the development language of \SpecialChar LyX
165 If you just want to use \SpecialChar LyX
166 , then you don't need to read this manual.
167 However, if you want to learn more about how \SpecialChar LyX
168 is developed, or even want
169 to participate in \SpecialChar LyX
170 development, you may find some interesting information
174 \begin_layout Section
178 \begin_layout Standard
180 uses several custom file formats for configuration files and documents.
181 This chapter contains some background concerning these file formats.
182 Several file formats are also described in detail in the regular user documenta
186 \begin_layout Subsection
190 \begin_layout Subsection
191 When is an update of the .lyx file format number needed?
192 \begin_inset CommandInset label
194 name "sec:When-is-an"
201 \begin_layout Standard
202 When you are working on a new feature you may ask yourself whether it needs
203 an update of the .lyx file format number.
204 Whether an update is needed or not is not always obvious.
209 Whenever there is the danger that a previous version of LyX cannot open
210 a file using the new feature, a file format update is needed.
213 \begin_layout Standard
214 The file format change allows lyx2lyx rules to implement backwards compatibility.
215 Below you can find a list of reasons for file format updates with explanations:
218 \begin_layout Description
227 setting Whenever you introduce a new setting that is stored in the document
228 header, a file format update is needed.
231 \begin_layout Description
240 setting If a certain setting becomes obsolete and gets removed, a file format
244 \begin_layout Description
270 \begin_inset space \thinspace{}
277 \begin_layout Description
278 \paragraph_spacing single
291 package The reason for this is that there is no true ERT inset for math
292 formulas: Each command is parsed, and if a user happens to define a local
293 command with the same name as a command that triggers an automatic load
294 of a package, they need to be able to switch off the automatic loading
296 This switch is stored by the
297 \begin_inset Flex Code
300 \begin_layout Plain Layout
309 \begin_layout Description
314 language that is stored in
315 \begin_inset Flex Code
318 \begin_layout Plain Layout
328 \begin_inset Note Note
331 \begin_layout Plain Layout
332 This requirement is under discussion.
341 \begin_layout Description
346 inset Of course a new inset requires a file format update.
349 \begin_layout Description
354 style If a new style or inset layout is added to any layout file or module
355 shipped with \SpecialChar LyX
356 , then a new file format is needed in the master (development)
358 It is possible to backport new styles to the stable version without a file
361 \begin_inset CommandInset ref
363 reference "subsec:Backporting-new-styles"
367 for more information.
370 \begin_layout Description
375 style If a style or inset layout is removed in any layout file or module
376 shipped with \SpecialChar LyX
377 , a new file format is required.
380 \begin_layout Standard
385 layouts and modules do
389 require a file format update (changed 03/16, see
390 \begin_inset CommandInset ref
392 reference "subsec:New-layouts"
400 \begin_layout Standard
401 If you are still unsure, please ask on the development list.
404 \begin_layout Subsection
405 \begin_inset CommandInset label
407 name "subsec:update_lyx_files"
411 How to update the file format number of .lyx files
414 \begin_layout Standard
415 Once you come to the conclusion that a file format update is needed, you
416 should use the following procedure to perform the update:
419 \begin_layout Enumerate
420 Implement and test the new feature, including the reading and writing of
422 Note that any file produced at this stage does not use a valid format,
423 so do not use this version of \SpecialChar LyX
424 for working on any important documents.
427 \begin_layout Enumerate
428 \begin_inset CommandInset label
430 name "enu:Describe_format"
434 Describe the new format in
435 \begin_inset Flex Code
438 \begin_layout Plain Layout
447 \begin_layout Enumerate
448 Update the \SpecialChar LyX
449 file format number in
450 \begin_inset Flex Code
453 \begin_layout Plain Layout
462 \begin_layout Enumerate
463 Update the range of file formats in the array
464 \begin_inset Flex Code
467 \begin_layout Plain Layout
474 \begin_inset Flex Code
477 \begin_layout Plain Layout
486 \begin_layout Enumerate
487 \begin_inset CommandInset label
489 name "enu:Add-an-entry"
493 Add an entry to both format lists (for conversion and reversion) in
494 \begin_inset Newline newline
498 \begin_inset Flex Code
501 \begin_layout Plain Layout
502 lib/lyx2lyx/lyx_2_3.py
508 Add a conversion routine if needed (e.
509 \begin_inset space \thinspace{}
512 g., a new header setting always needs a conversion that adds the new setting,
513 but a new document language does not need one).
514 Add a reversion routine if needed.
516 \begin_inset Newline newline
519 While the conversion routine is required to produce a document that is equivalen
520 t to the old version, the requirements of the reversion are not that strict.
521 If possible, try to produce a proper reversion, using ERT if needed, but
522 for some features this might be too complicated.
523 In this case, the minimum requirement of the reversion routine is that
524 it produces a valid document which can be read by an older \SpecialChar LyX
526 If absolutely needed, even data loss is allowed for the reversion.
527 (In that case, you might want to add a LyX comment that indicates what
528 you have had to do, so the user is at least warned).
531 \begin_layout Enumerate
532 Since tex2lyx has several implicit file format dependencies caused by sharing
533 code with \SpecialChar LyX
534 , updating the file format of .lyx files produced by tex2lyx at
535 the same time as updating the main .lyx file format is strongly recommended.
536 Therefore, a compiler warning will be issued if the \SpecialChar LyX
537 and tex2lyx .lyx file
538 format numbers differ.
539 In many cases the tex2lyx update requires only the first and last item
544 \begin_layout Enumerate
545 Update the tex2lyx file format number in
546 \begin_inset Flex Code
549 \begin_layout Plain Layout
558 \begin_layout Enumerate
559 If the lyx2lyx conversion from the old to the new format is empty, or if
560 tex2lyx does not yet output the changed feature, you do not need any further
562 Otherwise, search for the changed feature in tex2lyx, and adjust the output
563 according to the lyx2lyx changes.
566 \begin_layout Enumerate
567 Update the tex2lyx test references as described in
568 \begin_inset CommandInset ref
569 LatexCommand formatted
570 reference "sec:Updating-test-references"
578 \begin_layout Enumerate
579 If you did not implement full tex2lyx support for the new feature, add a
581 \begin_inset Flex Code
584 \begin_layout Plain Layout
590 describing the missing bits.
591 Note that it is perfectly fine if you do not add full tex2lyx support for
592 a new feature: The updating recommendation above is only issued for the
593 syntax of the produced .lyx file.
594 It is no problem if some features supported by \SpecialChar LyX
595 are still output as ERT
597 The problems in the past that resulted in the update recommendation were
598 related to mixed version syntax, not ERT.
601 \begin_layout Enumerate
602 It would be nice if you could create a .lyx test file which contains instances
603 of all changed or added features.
604 This could then be used to test lyx2lyx and tex2lyx.
605 Unfortunately, it has not yet been decided how to collect such examples,
606 so please ask on the development list if you want to create one.
609 \begin_layout Enumerate
610 \begin_inset CommandInset label
612 name "enu:updatefiles"
616 Update LyX's .lyx documentation files to the new format.
617 The developer who makes the change knows best what changes to expect when
618 inspecting the resulting diff.
619 Because of this, you might be able to catch a bug in the lyx2lyx code that
620 updates the format just by taking a quick scan through the large diff that
622 \begin_inset Note Note
625 \begin_layout Plain Layout
626 Another advantage is that if later we suspect a bug in lyx2lyx we can easily
627 see which layout update made an unexpected change by looking at the git
628 log of a .lyx file that suffers the problem.
633 To do this, first make sure that there are no changes to the git repository
634 that you will not want to commit (this is needed because it will be convenient
635 to commit with the command
636 \begin_inset Flex Code
639 \begin_layout Plain Layout
646 Then run the following command in the root folder of the source:
647 \begin_inset Flex Code
650 \begin_layout Plain Layout
651 python development/tools/updatedocs.py
657 Look at the resulting changes using the command
658 \begin_inset Flex Code
661 \begin_layout Plain Layout
668 If anything looks surprising, please investigate.
669 Keep in mind that the case of
670 \begin_inset Flex Code
673 \begin_layout Plain Layout
679 is special, because it is first generated with
680 \begin_inset Flex Code
683 \begin_layout Plain Layout
689 before being converted to the latest format.
690 Finally, commit using
691 \begin_inset Flex Code
694 \begin_layout Plain Layout
703 \begin_layout Subsection
704 Updating the file format number of layout files
707 \begin_layout Standard
708 The procedure for updating the layout files is similar to that in step
709 \begin_inset CommandInset ref
711 reference "enu:updatefiles"
716 \begin_inset CommandInset ref
718 reference "subsec:update_lyx_files"
724 \begin_inset Flex Code
727 \begin_layout Plain Layout
728 python development/tools/updatelayouts.py
734 \begin_inset Flex Code
737 \begin_layout Plain Layout
746 \begin_layout Standard
747 Note that we do not automatically any local layout used in the
748 \begin_inset Flex Code
751 \begin_layout Plain Layout
757 files shipped with \SpecialChar LyX
758 because users would then not be able to export to older
760 For example, if a 2.2.0 user exported a template to 2.1.x format and tried
761 to open the file in \SpecialChar LyX
762 2.1.x, there would be an error because the file would
763 contain a local layout whose format is too new.
764 The root reason for this is that we do not support converting layouts to
765 older layout formats, as we do for the
766 \begin_inset Flex Code
769 \begin_layout Plain Layout
778 \begin_layout Subsection
779 Updating the file format number of bind/ui files
782 \begin_layout Standard
783 A change to the functionality of existing LFUNs can require a conversion
785 \begin_inset Flex Code
788 \begin_layout Plain Layout
795 \begin_inset Flex Code
798 \begin_layout Plain Layout
804 files, and therefore an increment of the LFUN format, as well as a conversion
806 \begin_inset Flex Code
809 \begin_layout Plain Layout
816 The latter cannot be done automatically and also requires an update of
820 \begin_inset space \space{}
823 of someone who might have made a set of \SpecialChar LyX
824 teaching manuals for use in their
829 \begin_layout Plain Layout
830 \begin_inset Flex URL
833 \begin_layout Plain Layout
835 http://www.lyx.org/trac/ticket/9794
848 \begin_layout Standard
849 To update the LFUN format:
852 \begin_layout Enumerate
853 Increment the LFUN file format number in
854 \begin_inset Flex Code
857 \begin_layout Plain Layout
866 \begin_layout Enumerate
867 Implement the LFUN conversion in
868 \begin_inset Flex Code
871 \begin_layout Plain Layout
872 lib/scripts/prefs2prefs_lfuns.py
880 \begin_layout Enumerate
882 \begin_inset CommandInset ref
884 reference "enu:updatefiles"
889 \begin_inset CommandInset ref
891 reference "subsec:update_lyx_files"
896 \begin_inset Flex Code
899 \begin_layout Plain Layout
905 command, use this command:
906 \begin_inset Flex Code
909 \begin_layout Plain Layout
910 bash development/tools/updatelfuns.sh
917 \begin_inset Note Note
920 \begin_layout Plain Layout
921 This file should really be converted to python.
929 \begin_layout Enumerate
930 Update Info insets in
931 \begin_inset Flex Code
934 \begin_layout Plain Layout
941 To do so, increment the \SpecialChar LyX
942 format and proceed as in
943 \begin_inset CommandInset ref
945 reference "subsec:update_lyx_files"
950 \begin_inset CommandInset ref
952 reference "enu:Describe_format"
957 \begin_inset CommandInset ref
959 reference "enu:updatefiles"
964 In the lyx2lyx implementation (step
965 \begin_inset CommandInset ref
967 reference "enu:Add-an-entry"
971 ), implement a conversion similar to the one in
972 \begin_inset Flex Code
975 \begin_layout Plain Layout
981 above, as well as a corresponding reversion; for this one can use
982 \begin_inset Flex Code
985 \begin_layout Plain Layout
992 \begin_inset Flex Code
995 \begin_layout Plain Layout
996 lib/lyx2lyx/lyx2lyx_tools.py
1005 \begin_layout Subsection
1006 Backporting new styles to the stable version
1007 \begin_inset CommandInset label
1009 name "subsec:Backporting-new-styles"
1016 \begin_layout Standard
1017 Starting with the stable \SpecialChar LyX
1018 2.1 branch, there is a mechanism in place to backport
1019 new styles to the stable version without the need to update the file format.
1020 The basic idea is that the new style definition is automatically copied
1021 to the document preamble so that it can even be used by older minor versions
1022 that did not yet include the style.
1023 To backport a new style to the stable version, the following steps are
1027 \begin_layout Enumerate
1029 \begin_inset Flex Code
1032 \begin_layout Plain Layout
1038 to the style definition in the development version.
1041 \begin_layout Enumerate
1042 Copy the style definition to the stable version, but use
1043 \begin_inset Flex Code
1046 \begin_layout Plain Layout
1053 If needed adjust the format to the one used by the stable version (see
1054 the customization manual for details of the layout file format).
1057 \begin_layout Enumerate
1058 For each update of the style in a later stable version, increase the argument
1060 \begin_inset Flex Code
1063 \begin_layout Plain Layout
1070 (In the stable version, the development version should not be touched.)
1073 \begin_layout Standard
1074 For details about the
1075 \begin_inset Flex Code
1078 \begin_layout Plain Layout
1084 flag see the customization manual.
1086 \begin_inset Flex Code
1089 \begin_layout Plain Layout
1095 support is needed for backported styles: Since the style of the development
1096 version has an infinite version number, it will always be used.
1097 Furthermore, since its version number is less than one, the style will
1098 not be written anymore to the document header for files saved by the new
1102 \begin_layout Section
1103 New layouts and modules
1106 \begin_layout Subsection
1107 \begin_inset CommandInset label
1109 name "subsec:New-layouts"
1116 \begin_layout Standard
1117 Adding a new layout file to the \SpecialChar LyX
1119 \begin_inset Quotes eld
1122 officially supported
1123 \begin_inset Quotes erd
1127 You should therefore think carefully about whether you really want to do
1128 this and discuss it on lyx-devel, since you will need to be prepared to
1129 update and fix the layout if necessary.
1130 If the layout is experimental or for a rarely used document class, then
1131 it may be better to add it to the relevant portion of the \SpecialChar LyX
1135 \begin_inset CommandInset href
1137 target "https://wiki.lyx.org/Layouts/Layouts"
1144 \begin_layout Standard
1145 In older versions of this document, it was stated that new layout files
1146 require a file format change.
1147 After some discussion, it was decided that this is not needed.
1151 \begin_layout Plain Layout
1153 \begin_inset CommandInset href
1155 name "the thread “Proposal for a guide on updating layouts”"
1156 target "http://permalink.gmane.org/gmane.editors.lyx.devel/161202"
1169 For reference, here are the arguments on each side
1173 \begin_layout Description
1175 \begin_inset Quotes eld
1178 New layout files are a file format change
1179 \begin_inset Quotes erd
1185 \begin_layout Itemize
1186 All documents produced by 2.2.
1187 \begin_inset Formula $x$
1190 can always be edited and exported even if
1191 \begin_inset Formula $x$
1195 This is important for people using different machines, or exchanging work
1199 \begin_layout Description
1201 \begin_inset Quotes eld
1204 New layout files are not a file format change
1205 \begin_inset Quotes erd
1211 \begin_layout Itemize
1212 No new LaTeX classes can be supported in a stable version, and stable versions
1213 have a typical lifetime of 2–3 years.
1216 \begin_layout Itemize
1217 We have the same situation already with custom layout files: If a document
1218 using a custom layout file is moved between machines or people, then the
1219 layout file needs to be exchanged as well.
1220 If that is not done, then we have a fallback implemented so that such documents
1221 can still be edited, but not exported, and the user gets a warning.
1225 \begin_layout Itemize
1226 The lyx2lyx script cannot do anything useful in such a case.
1230 \begin_layout Standard
1231 If you have decided that you are going to add a new layout file to \SpecialChar LyX
1233 then, you should do the following:
1236 \begin_layout Enumerate
1237 Put your new layout file in
1238 \begin_inset Flex Code
1241 \begin_layout Plain Layout
1248 \begin_inset Flex Code
1251 \begin_layout Plain Layout
1252 git add lib/layouts/newlayout.layout
1257 ) so that it will be committed.
1260 \begin_layout Enumerate
1262 \begin_inset Flex Code
1265 \begin_layout Plain Layout
1271 , so that the new layout actually gets installed.
1274 \begin_layout Enumerate
1276 \begin_inset Flex Code
1279 \begin_layout Plain Layout
1280 lib/doc/LaTeXConfig.lyx
1285 containing in particular a line like
1293 \begin_layout Standard
1294 where [InsetInfo] is obtained by entering in the minibuffer (Alt+X)
1295 \begin_inset Flex Code
1298 \begin_layout Plain Layout
1299 info-insert textclass <name>
1305 This inset will automatically display a boxed
1306 \begin_inset Quotes eld
1310 \begin_inset Quotes erd
1314 \begin_inset Quotes eld
1318 \begin_inset Quotes erd
1321 depending on the availability of the package.
1325 \begin_layout Enumerate
1326 A template or example is strongly encouraged (but not necessarily required).
1327 It is also possible to provide both.
1329 \begin_inset Flex Code
1332 \begin_layout Plain Layout
1339 \begin_inset Flex Code
1342 \begin_layout Plain Layout
1351 \begin_layout Enumerate
1352 Reconfigure \SpecialChar LyX
1356 \begin_layout Enumerate
1357 Ensure the autotests for the new layout pass (see
1358 \begin_inset CommandInset ref
1360 reference "par:when-to-run-an-export-test"
1367 \begin_layout Subsection
1371 \begin_layout Standard
1372 Adding a new module is very similar to adding a new layout.
1373 Therefore, the previous section applies to new modules as well, with two
1377 \begin_layout Enumerate
1378 You only need to add an entry to
1379 \begin_inset Flex Code
1382 \begin_layout Plain Layout
1383 lib/doc/LaTeXConfig.lyx
1388 if the module requires a LaTeX package.
1389 In that case, the command for entering the InsetInfo is:
1390 \begin_inset Flex Code
1393 \begin_layout Plain Layout
1394 \paragraph_spacing single
1395 info-insert package <name>
1403 \begin_layout Enumerate
1404 Modules do not need a template, only an example, which is strongly encouraged
1405 but not necessarily required.
1408 \begin_layout Subsection
1409 Layouts for document classes with incompatible versions
1412 \begin_layout Standard
1413 \begin_inset Note Greyedout
1416 \begin_layout Description
1417 Note: This section is currently only a proposal under discussion.
1418 Please correct/amend as suited.
1419 Remove this note once a consensus is found.
1422 \begin_layout Plain Layout
1424 \begin_inset Quotes eld
1427 Proposal for a guide on updating layouts
1428 \begin_inset Quotes erd
1431 for details and background
1434 \begin_layout Plain Layout
1435 http://permalink.gmane.org/gmane.editors.lyx.devel/161126
1443 \begin_layout Standard
1444 Every now and then, there are changes to LaTeX document classes that break
1445 backwards compatibility.
1449 \begin_layout Plain Layout
1450 Uwe has suggested we implement automatic detection of changes in class files.
1451 This could be done by running a script every month that checks if a document
1452 class was changed at CTAN and at the homepages of the scientific journals.
1453 If it reports a change, we can check if our template and layout file are
1454 still usable with the changed document class.
1455 (This is different from the autotests insofar, as this would also catch
1456 changes that do not result in compilation errors.)
1461 Reasons can be a new name for the
1462 \begin_inset Flex Code
1465 \begin_layout Plain Layout
1471 file, removed \SpecialChar LaTeX
1473 How should this best be handled in \SpecialChar LyX
1477 \begin_layout Standard
1478 The idea is to support the new version with a new \SpecialChar LyX
1482 \begin_layout Itemize
1483 Existing documents can still be opened in \SpecialChar LyX
1484 and will continue to work on
1485 systems where the old version is still installed.
1489 \begin_layout Itemize
1490 With differently named
1491 \begin_inset Flex Code
1494 \begin_layout Plain Layout
1500 files, \SpecialChar LyX
1501 can check for the availability of the particular version and reflect
1503 Different document class versions with the same file name are currently
1504 (2.2.x) not detected by the configuration script.
1505 This is planned for 2.3.
1509 \begin_layout Plain Layout
1510 https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg192467.html
1513 \begin_layout Plain Layout
1514 However, what we really need is version detection for the configuration,
1515 so that the user can be warned if the required class file has the wrong
1517 (If the class file keeps the name over the version change, only one of
1518 the two layout files generates compilable documents.)
1521 \begin_layout Plain Layout
1522 This point was also made here: http://permalink.gmane.org/gmane.editors.lyx.devel/143
1531 \begin_layout Itemize
1532 The new layout can be added both to the master and the stable branches,
1533 in accord with the policy discussed in
1534 \begin_inset CommandInset ref
1535 LatexCommand formatted
1536 reference "subsec:New-layouts"
1541 No lyx2lyx conversion is then required when a new major version is released.
1544 \begin_layout Standard
1545 The user can move an existing document to the new version simply by selecting
1546 a new document class.
1547 This step is well supported by \SpecialChar LyX
1548 , with established methods for handling
1549 unsupported styles and other changes.
1550 This way, no lyx2lyx code is required.
1553 \begin_layout Standard
1554 The steps to support a new version of an existing document class are thus:
1557 \begin_layout Itemize
1558 Create a new layout file including the upstream version in the name (avoid
1559 special characters like spaces and dots), e.g.
1561 \begin_inset Flex Code
1564 \begin_layout Plain Layout
1565 acmsiggraph-v0-92.layout
1573 \begin_layout Itemize
1574 Include the name of the
1575 \begin_inset Flex Code
1578 \begin_layout Plain Layout
1584 file as an optional argument in the
1585 \begin_inset Flex Code
1588 \begin_layout Plain Layout
1596 line and include the version number in the GUI name:
1597 \begin_inset Newline newline
1601 \begin_inset Flex Code
1604 \begin_layout Plain Layout
1607 DeclareLaTeXClass[acmsiggraph]{ACM SIGGGRAPH (v.
1608 \begin_inset space ~
1619 \begin_layout Itemize
1620 Update the GUI name in the old layout file (whose name should not be changed),
1622 \begin_inset Newline newline
1626 \begin_inset Flex Code
1629 \begin_layout Plain Layout
1632 DeclareLaTeXClass{ACM SIGGRAPH (<= v.
1633 \begin_inset space ~
1644 \begin_layout Itemize
1645 To avoid duplicate definitions, the new layout can
1646 \begin_inset Flex Code
1649 \begin_layout Plain Layout
1655 the old layout file and add\SpecialChar breakableslash
1656 remove\SpecialChar breakableslash
1657 obsolete\SpecialChar breakableslash
1658 modify settings and styles (similar
1660 \begin_inset Flex Code
1663 \begin_layout Plain Layout
1673 \begin_layout Standard
1674 It may be tempting to let the new layout be the
1675 \begin_inset Quotes eld
1679 \begin_inset Quotes erd
1682 and have the old layout import it.
1683 However, this should not be done because any changes to the new layout
1684 would need undo steps in the importing old layout.
1688 \begin_layout Itemize
1689 If the new LaTeX document class obsoletes the old one, update the example
1690 and template files to use the new layout.
1691 Add a note about the changes (preferably with a pointer to the documentation
1696 \begin_layout Standard
1697 This way, new documents based on the template or example will use the up-to-date
1698 document class version.
1702 \begin_layout Standard
1703 \begin_inset Newpage newpage
1709 \begin_layout Section
1713 \begin_layout Standard
1714 Automated tests are an important tool to detect bugs and regressions in
1715 software development.
1716 Some projects like gcc even require each bug fix to be accompanied by a
1717 test case for the automatic test suite, that would detect this bug.
1718 Testing interactive features automatically is of course very hard, but
1719 core functionality like document import and export can be tested quite
1720 easily, and some tests of this kind exist.
1723 \begin_layout Subsection
1727 \begin_layout Standard
1728 There are attempts to set up a suite of unit tests for LyX.
1731 \begin_layout Standard
1732 TODO: describe what is done and what is still to do.
1735 \begin_layout Subsection
1739 \begin_layout Standard
1740 The tex2lyx tests are located in the
1741 \begin_inset Flex Code
1744 \begin_layout Plain Layout
1750 subfolder of the \SpecialChar LyX
1751 source code distribution.
1752 The actual testing is performed by the simple python script
1753 \begin_inset Flex Code
1756 \begin_layout Plain Layout
1757 src/tex2lyx/test/runtests.py
1763 Each test consists of two files:
1764 \begin_inset Flex Code
1767 \begin_layout Plain Layout
1773 contains the \SpecialChar LaTeX
1774 code that should be tested.
1776 \begin_inset Flex Code
1779 \begin_layout Plain Layout
1785 contains the expected output of tex2lyx.
1786 When a test is run, the actual produced output is compared with the stored
1788 The test passes if both are identical.
1789 The test machinery is also able to generate a file
1790 \begin_inset Flex Code
1793 \begin_layout Plain Layout
1799 by exporting the produced .lyx file with \SpecialChar LyX
1801 This may be useful for roundtrip comparisons.
1804 \begin_layout Subsubsection
1808 \begin_layout Standard
1809 The tex2lyx tests can be run in several ways.
1811 \begin_inset Flex Code
1814 \begin_layout Plain Layout
1820 subfolder of the build directory, the commands
1821 \begin_inset Flex Code
1824 \begin_layout Plain Layout
1830 (cmake, all platforms),
1831 \begin_inset Flex Code
1834 \begin_layout Plain Layout
1840 (cmake, when using a make based build system and not MSVC) or
1841 \begin_inset Flex Code
1844 \begin_layout Plain Layout
1850 (autotools) will run the tex2lyx tests.
1851 Alternatively, in the root of the build directory, the command
1852 \begin_inset Flex Code
1855 \begin_layout Plain Layout
1861 runs all tests whose names match the regex
1862 \begin_inset Quotes eld
1866 \begin_inset Quotes erd
1870 Another way to run the tex2lyx tests in the root build directory is to
1871 instead use the command
1872 \begin_inset Flex Code
1875 \begin_layout Plain Layout
1876 ctest -L '(cmplyx|roundtrip)'
1881 , which runs all tests categorized with the label
1882 \begin_inset Quotes eld
1886 \begin_inset Quotes erd
1890 \begin_inset Quotes eld
1894 \begin_inset Quotes erd
1898 If a test fails, the differences between the expected and actual results
1899 are output in unified diff format.
1902 \begin_layout Subsubsection
1903 Updating test references
1904 \begin_inset CommandInset label
1906 name "sec:Updating-test-references"
1913 \begin_layout Standard
1914 In some cases a changed tex2lyx output is not a test failure, but wanted,
1916 \begin_inset space \thinspace{}
1920 \begin_inset space \space{}
1923 if a tex2lyx bug was fixed, or a new feature was added.
1924 In these cases the stored references need to be updated.
1925 To do so if using autotools, call
1926 \begin_inset Flex Code
1929 \begin_layout Plain Layout
1936 \begin_inset Flex Code
1939 \begin_layout Plain Layout
1945 subdirectory of the build directory.
1946 If instead using CMake, call
1947 \begin_inset Flex Code
1950 \begin_layout Plain Layout
1951 make updatetex2lyxtests
1956 in the build directory or in the
1957 \begin_inset Flex Code
1960 \begin_layout Plain Layout
1966 subdirectory of the build directory.
1970 \begin_layout Plain Layout
1971 Note that this is a case where a make target in the build directory can
1972 affect the source directory, which might not be advisable.
1977 On Windows do the following:
1980 \begin_layout Itemize
1981 Assure that the path to the python.exe is in your system PATH variable.
1984 \begin_layout Itemize
1985 Double-click on the file
1986 \begin_inset Flex Code
1989 \begin_layout Plain Layout
1990 updatetex2lyxtests.vcxproj
1995 in the build directory or in the
1996 \begin_inset Flex Code
1999 \begin_layout Plain Layout
2005 subdirectory of your build directory.
2008 \begin_layout Itemize
2009 In the appearing MSVC program right-click on the project
2013 in the project explorer and chose
2020 \begin_layout Standard
2021 For convenience, these commands also produce re-exported roundtrip .lyx.tex
2023 Please examine the changed output carefully before committing the changed
2024 files to the repository: Since the test machinery does not do a roundtrip
2026 \begin_inset Formula $\Rightarrow$
2030 \begin_inset Formula $\Rightarrow$
2033 .tex, and does not compare the produced dvi or pdf output, it assumes that
2034 the stored .lyx reference produces correct output if processed by \SpecialChar LyX
2036 There is only one chance to detect wrong output: before committing a new
2038 Once it is committed, it is quite difficult to verify whether it is correct.
2041 \begin_layout Standard
2046 update the test references by opening them with \SpecialChar LyX
2047 or directly running lyx2lyx
2049 This would not work, since lyx2lyx and \SpecialChar LyX
2050 produce slightly different files
2051 regarding insignificant whitespace and line breaks.
2054 \begin_layout Subsubsection
2058 \begin_layout Standard
2059 In many cases tests for new features may be added to one of the existing
2060 test files, but sometimes this is not possible or not wanted.
2061 Then a new test file needs to be added:
2064 \begin_layout Enumerate
2066 \begin_inset Flex Code
2069 \begin_layout Plain Layout
2070 src/tex2lyx/test/<test name>.tex
2075 and run tex2lyx in roundtrip mode to produce the file
2076 \begin_inset Flex Code
2079 \begin_layout Plain Layout
2080 src/tex2lyx/test/<test name>.lyx.lyx
2086 This file will be the new reference.
2089 \begin_layout Enumerate
2090 Once you confirmed that the tex2lyx output is correct, add the new files
2091 to the corresponding lists in
2092 \begin_inset Flex Code
2095 \begin_layout Plain Layout
2096 src/tex2lyx/test/runtests.py
2102 \begin_inset Flex Code
2105 \begin_layout Plain Layout
2106 src/tex2lyx/Makefile.am
2112 \begin_inset Flex Code
2115 \begin_layout Plain Layout
2116 src/tex2lyx/test/CMakeLists.txt
2124 \begin_layout Enumerate
2125 Commit the changes to the repository, or send a patch to the development
2126 list and ask for committing if you do not have commit rights.
2129 \begin_layout Subsection
2130 ctest automatic tests
2133 \begin_layout Standard
2134 Some tests are located in the
2135 \begin_inset Flex Code
2138 \begin_layout Plain Layout
2139 development/autotests/
2144 subfolder of the \SpecialChar LyX
2145 source code distribution.
2150 \begin_layout Plain Layout
2151 The README document in this folder only describes the
2152 \begin_inset Quotes eld
2156 \begin_inset Quotes erd
2159 subset of autotests!
2167 \begin_layout Standard
2168 These tests can be run by the commands
2169 \begin_inset Flex Code
2172 \begin_layout Plain Layout
2182 (all platforms) or (when using a make based build system and not MSVC)
2184 \begin_inset Flex Code
2187 \begin_layout Plain Layout
2194 \begin_inset Flex Code
2197 \begin_layout Plain Layout
2208 The test logs are written to the
2209 \begin_inset Flex Code
2212 \begin_layout Plain Layout
2226 \begin_layout Subsubsection
2230 \begin_layout Standard
2231 The export tests are integration tests.
2232 They take longer to run and are more likely to break than the tex2lyx tests.
2233 Nevertheless, they have caught many regressions and without a better alternativ
2234 e it is important to keep them up-to-date and understand how they work.
2237 \begin_layout Standard
2239 \begin_inset Quotes eld
2243 \begin_inset Quotes erd
2246 documentation, template, and example documents.
2247 In addition, there are a number of dedicated sample documents in the
2248 \begin_inset Flex Code
2251 \begin_layout Plain Layout
2257 subfolder of the \SpecialChar LyX
2258 source code distribution.
2259 All samples are (after copying and eventual processing by scripts) exported
2260 to various output formats via the
2261 \begin_inset Flex Code
2264 \begin_layout Plain Layout
2270 command line option.
2271 The tests checks for errors reported by LyX.
2272 (However, error-free export is no guarantee for an error-free output document.)
2275 \begin_layout Paragraph
2276 \begin_inset CommandInset label
2278 name "par:when-to-run-an-export-test"
2282 Expectations of LyX developers
2285 \begin_layout Standard
2286 Because the export tests are integration tests and take a long time to run,
2287 LyX developers are rarely expected to run all of the tests.
2288 Here are some good practices to follow by developers:
2291 \begin_layout Itemize
2292 When making a non-trivial change to a .layout file, run the export and layout
2293 tests corresponding with that .layout file.
2296 \begin_layout Itemize
2297 When making non-trivial changes to a .lyx file, run the export tests correspondin
2298 g to that .lyx file.
2303 \begin_layout Plain Layout
2304 This rule is due to revision.
2308 \begin_layout Plain Layout
2309 There is an objection from the documentation maintainer that working on
2310 the documentation must not be complicated by having to consider non-standard
2314 \begin_layout Itemize
2315 successful compiling/testing an edited documentation file with pdflatex
2316 suffices to ensure it can be commited, not tests with other exports are
2320 \begin_layout Plain Layout
2321 If sudden failures with other exports due to “half-tested” documentation
2322 updates are a problem for the test maintainer, the test suite should use
2326 \begin_layout Itemize
2327 copied to a cache dir (autotests/samples/doc/, say) but not changed,
2330 \begin_layout Itemize
2331 updated regularely (but on a time chosen by the test suite maintainer) from
2332 the originals in lib/doc/
2335 \begin_layout Plain Layout
2339 \begin_layout Itemize
2340 no test will fail due to ongoing work on documentation,
2343 \begin_layout Itemize
2344 the documentation is still tested in full (with some delay),
2347 \begin_layout Itemize
2348 failures with non-default export can be examined and handled accordingly
2349 in one run with the cache update,
2352 \begin_layout Itemize
2353 “interesting failures” (like the nested-language+polyglossia problem in
2354 es/Customization can be separated and moved into dedicated test samples.
2362 \begin_layout Itemize
2363 When making non-trivial changes to LyX's \SpecialChar LaTeX
2365 touching the encoding code or package handling code that you expect will
2366 change the exported \SpecialChar LaTeX
2371 \begin_layout Standard
2372 \paragraph_spacing single
2373 Consider running all of the export tests before and after your change.
2374 If there are differences, please reconcile these (i.e.
2375 fix the bug or fix the tests)
2380 Ask for help if you're not sure what to.
2383 \begin_layout Standard
2384 If you do not want to run the tests,
2387 \begin_layout Itemize
2388 post the patch on the list and others will run the tests and eventually
2392 \begin_layout Itemize
2393 commit, but be prepared to fix eventually arising problems or to revert
2394 the commit if there is no easy fix.
2398 \begin_layout Itemize
2399 Understand how to interpret test failures.
2400 If your commit is found to have broken a test, you should be able to interpret
2401 the test results when made aware of them.
2403 \begin_inset CommandInset ref
2405 reference "subsec:Interpreting-export-tests"
2412 \begin_layout Paragraph
2413 \begin_inset CommandInset label
2415 name "par:export-test-output-formats"
2422 \begin_layout Standard
2423 The following output formats are currently tested for each sample document
2425 \begin_inset CommandInset ref
2427 reference "par:Export-test-filtering"
2434 \begin_layout Labeling
2435 \labelwidthstring 00.00.0000
2440 \begin_layout Labeling
2441 \labelwidthstring 00.00.0000
2442 lyx16 LyX 1.6 file format (lyx2lyx)
2445 \begin_layout Labeling
2446 \labelwidthstring 00.00.0000
2447 lyx21 LyX 2.1 file format (lyx2lyx)
2450 \begin_layout Labeling
2451 \labelwidthstring 00.00.0000
2452 xhtml LyXHTML (native LyX HTML export)
2456 \begin_layout Labeling
2457 \labelwidthstring 00.00.0000
2459 \begin_inset space ~
2463 \begin_inset space ~
2470 \begin_layout Labeling
2471 \labelwidthstring pdf5msystemFM
2472 dvi DVI (8-bit latex)
2475 \begin_layout Labeling
2476 \labelwidthstring pdf5msystemFM
2477 dvi3_texF DVI (LuaTeX with 8-bit TeX fonts)
2480 \begin_layout Labeling
2481 \labelwidthstring pdf5msystemFM
2482 dvi3_systemF DVI (LuaTeX with Unicode fonts)
2485 \begin_layout Labeling
2486 \labelwidthstring pdf5msystemFM
2490 \begin_layout Labeling
2491 \labelwidthstring pdf5msystemFM
2492 pdf4_texF PDF (XeTeX with 8-bit TeX fonts)
2495 \begin_layout Labeling
2496 \labelwidthstring pdf5msystemFM
2497 pdf4_systemF PDF (XeTeX with Unicode fonts)
2500 \begin_layout Labeling
2501 \labelwidthstring pdf5msystemFM
2502 pdf5_texF PDF (LuaTeX with 8-bit TeX fonts)
2505 \begin_layout Labeling
2506 \labelwidthstring pdf5msystemFM
2507 pdf5_systemF PDF (LuaTeX with Unicode fonts)
2511 \begin_layout Labeling
2512 \labelwidthstring 00.00.0000
2514 \begin_inset space ~
2518 \begin_inset space ~
2522 \begin_inset space ~
2526 \begin_inset space ~
2533 \begin_layout Labeling
2534 \labelwidthstring pdf5msystemFM
2535 pdf DVI -> PS (dvips) -> PDF (ps2pdf)
2538 \begin_layout Labeling
2539 \labelwidthstring pdf5msystemFM
2540 pdf3 DVI -> PDF (dvipdfm)
2544 \begin_layout Labeling
2545 \labelwidthstring 00.00.0000
2547 \begin_inset space ~
2550 tested: (or only if set as default output format in the document source)
2554 \begin_layout Labeling
2555 \labelwidthstring pdf5msystemFM
2559 \begin_layout Labeling
2560 \labelwidthstring pdf5msystemFM
2561 luatex LaTeX (LuaTeX)
2564 \begin_layout Labeling
2565 \labelwidthstring pdf5msystemFM
2566 dviluatex LaTeX (dviluatex)
2569 \begin_layout Labeling
2570 \labelwidthstring pdf5msystemFM
2571 pdflatex LaTeX (pdflatex)
2574 \begin_layout Labeling
2575 \labelwidthstring pdf5msystemFM
2576 platex LaTeX (pLaTeX)
2579 \begin_layout Labeling
2580 \labelwidthstring pdf5msystemFM
2584 \begin_layout Labeling
2585 \labelwidthstring pdf5msystemFM
2586 eps3 EPS (encapsulated Postscript) (cropped)
2589 \begin_layout Labeling
2590 \labelwidthstring pdf5msystemFM
2591 ps DVI -> Postscript (dvips)
2594 \begin_layout Labeling
2595 \labelwidthstring pdf5msystemFM
2599 \begin_layout Labeling
2600 \labelwidthstring pdf5msystemFM
2601 text (nor text2, ..., text4)
2604 \begin_layout Labeling
2605 \labelwidthstring pdf5msystemFM
2609 \begin_layout Labeling
2610 \labelwidthstring pdf5msystemFM
2614 \begin_layout Labeling
2615 \labelwidthstring pdf5msystemFM
2619 \begin_layout Labeling
2620 \labelwidthstring pdf5msystemFM
2625 \begin_layout Paragraph
2626 \begin_inset CommandInset label
2628 name "par:Configuring-ctests"
2632 Configuring the tests
2635 \begin_layout Standard
2636 To enable the export autotests, add the
2637 \begin_inset Flex Code
2640 \begin_layout Plain Layout
2641 -DLYX_ENABLE_EXPORT_TESTS=ON
2650 \begin_layout Standard
2651 \begin_inset Flex Code
2654 \begin_layout Plain Layout
2655 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
2663 \begin_layout Standard
2665 This flag will increase the time for the cmake command by several seconds,
2666 mainly because of the process of inverting tests (see Section
2667 \begin_inset CommandInset ref
2669 reference "subsec:Interpreting-export-tests"
2676 \begin_layout Paragraph
2677 \begin_inset CommandInset label
2679 name "par:ctest-options"
2686 \begin_layout Standard
2687 To run all tests, in the build directory simply run the command
2688 \begin_inset Flex Code
2691 \begin_layout Plain Layout
2698 A full, up-to-date TeXLive installation is recommended to run the tests.
2699 Otherwise, some tests will fail.
2700 Tests with additional requirements are labeled
2701 \begin_inset Quotes eld
2704 unreliable:nonstandard
2705 \begin_inset Quotes erd
2709 \change_inserted 34634807 1486630943
2714 \begin_layout Plain Layout
2716 \change_inserted 34634807 1486631129
2717 With an up-to-date Texlive 2016 installation, there are standard tests which
2718 will fail because of missing packages or external applications, see below
2719 for a list of those which should be installed to avoid these failures.
2732 \begin_layout Standard
2733 To run only some of the tests, use command line options (see examples below):
2736 \begin_layout Labeling
2737 \labelwidthstring -R
2738 \begin_inset Flex Code
2741 \begin_layout Plain Layout
2747 Run only the tests whose names match the given regular expression.
2750 \begin_layout Labeling
2751 \labelwidthstring -R
2752 \begin_inset Flex Code
2755 \begin_layout Plain Layout
2761 Run only the tests whose labels match the given regular expression.
2762 A test may have more that one label.
2766 \begin_layout Labeling
2767 \labelwidthstring -R
2768 \begin_inset Flex Code
2771 \begin_layout Plain Layout
2777 Exclude the tests whose names match the given regular expression.
2780 \begin_layout Labeling
2781 \labelwidthstring -R
2782 \begin_inset Flex Code
2785 \begin_layout Plain Layout
2791 Exclude the tests whose labels match the given regular expression.
2792 Cannot be combined with
2793 \begin_inset Flex Code
2796 \begin_layout Plain Layout
2805 \begin_layout Standard
2806 The following options help to find good selection patterns:
2809 \begin_layout Labeling
2810 \labelwidthstring -R
2811 \begin_inset Flex Code
2814 \begin_layout Plain Layout
2820 List the tests that would be run but not actually run them.
2825 \begin_layout Standard
2826 Useful in conjunction with the -R, -L, -E and -LE options, e.g., if you want
2827 to know how many tests there are or whether your
2828 \begin_inset Flex Code
2831 \begin_layout Plain Layout
2837 regular expression did what you expected.
2841 \begin_layout Labeling
2842 \labelwidthstring -R
2843 \begin_inset Flex Code
2846 \begin_layout Plain Layout
2847 \SpecialChar nobreakdash
2848 \SpecialChar nobreakdash
2854 print the list of all labels associated with the test set.
2855 Can also be combined with -R, -L, -E, ...
2859 \begin_layout Standard
2860 Other useful options are:
2863 \begin_layout Labeling
2864 \labelwidthstring -R
2865 \begin_inset Flex Code
2868 \begin_layout Plain Layout
2874 Run the tests in parallel using the given number of jobs.
2878 \begin_layout Standard
2879 We are still working on getting the tests to run in parallel.
2880 However, when running the tests in parallel, sometimes tests fail that
2881 pass when run sequentially.
2882 A reasonable approach is to first run the tests in parallel and then run
2883 the failed tests sequentially.
2886 \begin_layout Standard
2887 For example, to run 8 jobs at a time:
2890 \begin_layout Standard
2891 \begin_inset Flex Code
2894 \begin_layout Plain Layout
2903 \begin_layout Standard
2904 \begin_inset Flex Code
2907 \begin_layout Plain Layout
2908 ctest \SpecialChar nobreakdash
2909 \SpecialChar nobreakdash
2918 \begin_layout Standard
2919 When specifying a subset of the tests (e.g.
2921 \begin_inset Flex Code
2924 \begin_layout Plain Layout
2925 \SpecialChar nobreakdash
2931 ), the same subset must be specified when using the
2932 \begin_inset Flex Code
2935 \begin_layout Plain Layout
2936 \SpecialChar nobreakdash
2937 \SpecialChar nobreakdash
2943 option because it is the test numbers that are used to index which tests
2944 failed on the previous run.
2947 \begin_layout Standard
2949 Note that some tests cannot be run in parallel.
2950 These tests are marked in the code with the
2951 \begin_inset Flex Code
2954 \begin_layout Plain Layout
2965 \begin_layout Labeling
2966 \labelwidthstring -R
2967 \begin_inset Flex Code
2970 \begin_layout Plain Layout
2971 \SpecialChar nobreakdash
2972 \SpecialChar nobreakdash
2978 Set a global timeout on all tests that do not already have a timeout set
2983 \begin_layout Standard
2984 There have been bugs in LyX and in \SpecialChar LaTeX
2985 which cause compilation to hang, and
2986 without a timeout a test might never stop (in one case there was even a
2988 If a test times out, the
2989 \begin_inset Flex Code
2992 \begin_layout Plain Layout
2998 command exits with error, but you can distinguish between a timed out test
2999 and a failed test in the output reported at the end of the
3000 \begin_inset Flex Code
3003 \begin_layout Plain Layout
3013 \begin_layout Standard
3015 \begin_inset Flex Code
3018 \begin_layout Plain Layout
3024 ) the full list of command line options.
3027 \begin_layout Paragraph
3031 \begin_layout Itemize
3032 run only the export tests:
3033 \begin_inset Flex Code
3036 \begin_layout Plain Layout
3045 \begin_layout Itemize
3047 \begin_inset Flex Code
3050 \begin_layout Plain Layout
3051 ctest -L "inverted|suspended"
3059 \begin_layout Itemize
3060 list all export tests which match any of the labelling patterns:
3061 \begin_inset Flex Code
3064 \begin_layout Plain Layout
3075 \begin_layout Itemize
3076 exclude rarely used output formats and post-processing tests
3077 \begin_inset Flex Code
3080 \begin_layout Plain Layout
3081 ctest -L export -E "_(texF|dvi3|pdf3?)"
3089 \begin_layout Paragraph
3090 \begin_inset CommandInset label
3092 name "subsec:Interpreting-export-tests"
3096 Interpreting the export test results
3099 \begin_layout Standard
3100 A test can fail for several reasons, not all of them bad.
3103 \begin_layout Enumerate
3104 A new or edited sample document may be incompatible with some output formats.
3107 \begin_layout Enumerate
3108 A dependency is not met (e.g.
3109 the \SpecialChar LaTeX
3111 One hint that this is the case is that the corresponding
3112 \begin_inset Flex Code
3115 \begin_layout Plain Layout
3121 test will likely also fail.
3124 \begin_layout Enumerate
3125 An inverted test fails to fail (i.e.
3126 export that previously failed now works).
3129 \begin_layout Enumerate
3130 An external dependency was updated (e.g.
3135 \begin_layout Enumerate
3136 A recent code change introduced a bug.
3139 \begin_layout Enumerate
3140 \begin_inset CommandInset label
3146 A change in a document exposed a previously unknown bug or an incompatibility
3147 with an export format (e.g.
3148 Lua\SpecialChar LaTeX
3152 \begin_layout Standard
3153 Because the .lyx files are exported in several formats, it is not surprising
3154 that many of the exports fail.
3155 This expectation of failure is addressed by
3156 \begin_inset Quotes eld
3160 \begin_inset Quotes erd
3163 the tests, that is, by marking the test as
3164 \begin_inset Quotes eld
3168 \begin_inset Quotes erd
3171 if the export exits with error and as
3172 \begin_inset Quotes eld
3176 \begin_inset Quotes erd
3179 if the export succeeds
3184 It follows that these expected failures will not show up as failed tests
3185 in the test results and thus will not pollute the
3186 \begin_inset Quotes eld
3190 \begin_inset Quotes erd
3194 If the export actually succeeds, then the test will fail.
3195 The purpose of this failure is to get your attention—something has changed,
3196 possibly for the better.
3199 \begin_layout Standard
3200 We try to document why a test is inverted or ignored.
3201 See the comment (prefixed with
3202 \begin_inset Flex Code
3205 \begin_layout Plain Layout
3211 ) above the block in which the test is listed as inverted or ignored in
3213 \begin_inset Flex Code
3216 \begin_layout Plain Layout
3217 development/autotests/invertedTests
3223 \begin_inset Flex Code
3226 \begin_layout Plain Layout
3227 development/autotests/unreliableTests
3233 \begin_inset Flex Code
3236 \begin_layout Plain Layout
3237 development/autotests/ignoredTests
3246 \begin_layout Standard
3247 A good question is why do we enable the tests for non-default formats? The
3248 answer is that if a non-default route is broken it is often because a bug
3249 was introduced in LyX and not because a document-specific change was made
3250 that is not supported by the route.
3251 In other words, there is a high signal/noise ratio in the export tests
3252 for some non-default formats.
3256 \begin_layout Standard
3257 When a test or several tests fail, consider checking the files in the
3258 \begin_inset Flex Code
3261 \begin_layout Plain Layout
3267 subdirectory of your build directory.
3268 In this subdirectory are three files: the file
3269 \begin_inset Flex Code
3272 \begin_layout Plain Layout
3278 simply lists the tests that failed on your last
3279 \begin_inset Flex Code
3282 \begin_layout Plain Layout
3289 \begin_inset Flex Code
3292 \begin_layout Plain Layout
3298 file contains the output from the tests (and often has details explaining
3299 why a test failed); and the
3300 \begin_inset Flex Code
3303 \begin_layout Plain Layout
3309 file lists the times that it took to run the tests.
3312 \begin_layout Paragraph
3313 What action should you take if a test fails?
3316 \begin_layout Standard
3317 \paragraph_spacing single
3318 It is always good to check manually why something fails and if it passes
3319 if the PDF output is good.
3322 \begin_layout Itemize
3323 Generally, if a change breaks compilation for the target format (for the
3324 manuals pdf2) without solving some important other issue,
3326 fix or revert the commit
3328 that led to failure.
3331 \begin_layout Itemize
3332 If it is not possible to (immediately) fix the failure but there are reasons
3333 not to revert the commit (e.g.
3334 it fixes another more important issue),
3338 the failing test case (see
3339 \begin_inset CommandInset ref
3341 reference "par:Inverted-tests"
3348 \begin_layout Itemize
3353 test case fails because the export now works,
3357 the test by removing the pattern from the
3358 \begin_inset Quotes eld
3362 \begin_inset Quotes erd
3366 \begin_inset CommandInset ref
3368 reference "par:Inverted-tests"
3375 \begin_layout Itemize
3376 If the export did not fail previously but led to wrong output (PDF, say),
3380 \begin_layout Plain Layout
3381 Non-failing test with wrong output should be labeledas
3382 \begin_inset Quotes eld
3385 unreliable:wrong_output
3386 \begin_inset Quotes erd
3390 \begin_inset CommandInset ref
3392 reference "par:Unreliable-tests"
3401 it is in fact an improvement when the test now fails.
3406 the failing test case (see
3407 \begin_inset CommandInset ref
3409 reference "par:Inverted-tests"
3416 \begin_layout Itemize
3417 In case of tests failing due to missing requirements (tests labeled
3418 \begin_inset Quotes eld
3421 unreliable:nonstandard
3422 \begin_inset Quotes erd
3425 or testing on a system withonly a subset of TeXLive installed), ignore
3426 the failure, ask for someone else to run the test, or install the missing
3427 ressources and try again.
3428 \change_inserted 34634807 1486631183
3432 \begin_layout Standard
3434 \change_inserted 34634807 1486631268
3435 With TeXLive 2016, here are the resources which should be installed to avoid
3436 standard tests failure:
3439 \begin_layout Itemize
3441 \change_inserted 34634807 1486631544
3446 is needed for literate programming, so
3447 \begin_inset CommandInset href
3450 target "http://www.r-project.org"
3454 should be installed;
3457 \begin_layout Itemize
3459 \change_inserted 34634807 1487083795
3462 \begin_inset CommandInset href
3465 target "http://www.gnuplot.info/download.html"
3471 scripts are needed for spreadsheet export;
3474 \begin_layout Itemize
3476 \change_inserted 34634807 1487083980
3481 script should be installed, see the lilypond
3482 \begin_inset CommandInset href
3484 name "download page"
3485 target "http://lilypond.org/download.html"
3492 \begin_layout Itemize
3494 \change_inserted 34634807 1486634133
3497 \begin_inset CommandInset href
3500 target "https://www.ctan.org/pkg/foiltex"
3506 is not part of the TeXLive distribution;
3509 \begin_layout Itemize
3511 \change_inserted 34634807 1486631975
3512 LaTeX packages which are not in the
3513 \begin_inset Quotes eld
3516 collection-publishers
3517 \begin_inset Quotes erd
3520 TeXLive set are needed from editors of various papers and books:
3524 \begin_layout Itemize
3526 \change_inserted 34634807 1486634149
3527 Springer packages, see
3528 \begin_inset Flex URL
3531 \begin_layout Plain Layout
3533 \change_inserted 34634807 1486633436
3535 http://wiki.lyx.org/Examples/Springer
3545 \begin_layout Itemize
3547 \change_inserted 34634807 1486634154
3548 Astronomy & Astrophysics, see
3549 \begin_inset Flex URL
3552 \begin_layout Plain Layout
3554 \change_inserted 34634807 1486632086
3556 http://www.aanda.org/author-information/latex-issues/texnical-background-informati
3567 \begin_layout Itemize
3569 \change_inserted 34634807 1486721678
3571 \begin_inset CommandInset href
3574 target "http://www.acm.org/sigs/publications/acm_proc_article-sp.cls"
3579 \begin_inset CommandInset href
3582 target "http://drupal.sigplan.org/sites/default/files/sigplanconf.cls"
3587 \begin_inset CommandInset href
3590 target "http://www.siggraph.org/sites/default/files/acmsiggraph.zip"
3597 \begin_layout Itemize
3599 \change_inserted 34634807 1486721793
3600 American Economic Association, see
3601 \begin_inset CommandInset href
3604 target "https://wiki.lyx.org/Examples/AEA"
3611 \begin_layout Itemize
3613 \change_inserted 34634807 1486735769
3614 American Geophysical Union, the template changed in 2016, see
3615 \begin_inset CommandInset href
3618 target "http://publications.agu.org/files/2015/10/agutex2015.zip"
3623 \begin_inset CommandInset href
3626 target "https://publications.agu.org/files/2016/03/AGUJournal_Feb18_2016.zip"
3633 \begin_layout Itemize
3635 \change_inserted 34634807 1486735844
3636 Institute of Optics, see
3637 \begin_inset CommandInset href
3640 target "ftp://ftp.iop.org/pub/journals/ioplatexguidelines.tar.gz"
3647 \begin_layout Itemize
3649 \change_inserted 34634807 1486747241
3650 International Union of Cristallography, see
3651 \begin_inset CommandInset href
3654 target "http://wiki.lyx.org/Layouts/IUCr"
3661 \begin_layout Itemize
3663 \change_inserted 34634807 1486748022
3664 Journal of the Acoustical Society of America, see
3665 \begin_inset CommandInset href
3668 target "http://wiki.lyx.org/Layouts/JASATeX"
3675 \begin_layout Itemize
3677 \change_inserted 34634807 1486748960
3679 \begin_inset CommandInset href
3682 target "https://journal.r-project.org/submissions.html"
3689 \begin_layout Itemize
3691 \change_inserted 34634807 1486749098
3693 \begin_inset CommandInset href
3696 target "https://wiki.lyx.org/Examples/Econometrica"
3704 \begin_layout Paragraph
3705 \begin_inset CommandInset label
3707 name "par:Inverted-tests"
3714 \begin_layout Standard
3715 Test cases whose name matches a pattern in the file
3716 \begin_inset Flex Code
3719 \begin_layout Plain Layout
3720 development/autotests/invertedTests
3730 They get also the test property
3731 \begin_inset Flex Code
3734 \begin_layout Plain Layout
3741 they are reported as failing if the export works without error
3742 \begin_inset Flex URL
3745 \begin_layout Plain Layout
3747 https://cmake.org/cmake/help/v3.0/command/set_tests_properties.html
3755 \begin_layout Standard
3756 Add failing cases to this file, if they cannot be solved
3757 \begin_inset Quotes eld
3761 \begin_inset Quotes erd
3764 but it is expected that the export will work in a foreseeable future, e.g.
3765 low priority issues like failures to export to a non-target format (for
3766 the manuals everything except pdf2).
3769 \begin_layout Standard
3770 The following sublabels are currently present in
3771 \begin_inset Flex Code
3774 \begin_layout Plain Layout
3783 \begin_layout Description
3784 todo test failures that require attention:
3788 \begin_layout Itemize
3789 minor issues to explore and properly sort later,
3792 \begin_layout Itemize
3796 \begin_layout Itemize
3797 LyX bugs to report at trac (move pattern to section "lyxbugs" once done).
3801 \begin_layout Description
3802 lyxbugs LyX bugs with a Trac number.
3805 \begin_layout Description
3806 ert Export failures due to "raw" LaTeX use in ERT or preamble code.
3810 \begin_layout Standard
3811 "Wontfix" if demonstrating correct use and OK in the default output format.
3815 \begin_layout Description
3816 texissues Export fails due to LaTeX limitations like non-ASCII characters
3817 in verbatim or listings, incompatible packages, ...
3821 \begin_layout Standard
3822 "Wontfix" if documents demonstrate correct use in the default output format:
3825 \begin_layout Itemize
3826 If the source can be made more robust without becoming "hackish", fix the
3830 \begin_layout Itemize
3831 if LyX could be enhanced to care for a permanent TeX limitation, file a
3832 ticket at trac and add a pattern under lyxbugs,
3835 \begin_layout Itemize
3836 otherwise, add a pattern here.
3840 \begin_layout Description
3841 attic Documents in the attic (kept for reference and format conversion test).
3843 \begin_inset Quotes eld
3847 \begin_inset Quotes erd
3853 \begin_layout Subparagraph
3857 \begin_layout Standard
3858 Test cases whose name additionally matches a pattern in the file
3859 \begin_inset Flex Code
3862 \begin_layout Plain Layout
3863 development/autotests/suspendedTests
3881 This means they are not executed using
3882 \begin_inset Flex Code
3885 \begin_layout Plain Layout
3892 \begin_inset Flex Code
3895 \begin_layout Plain Layout
3902 However, they also get the test property
3903 \begin_inset Flex Code
3906 \begin_layout Plain Layout
3913 they are reported as failing if the export works without error.
3914 From time to time they still have to be checked using
3915 \begin_inset Flex Code
3918 \begin_layout Plain Layout
3927 \begin_layout Standard
3928 These tests are suspended, because the export fails for known reasons which
3929 cannot ATM be resolved.
3930 But it is expected the reason might disappear in the future.
3931 Be it new TL or better handling in \SpecialChar LyX
3935 \begin_layout Standard
3936 For ctest commands without the
3937 \begin_inset Flex Code
3940 \begin_layout Plain Layout
3946 parameter nothing changes.
3947 Suspended or not, tests will be executed depending only on the selecting
3948 regular expression given to the ctest command (see
3949 \begin_inset CommandInset ref
3951 reference "par:ctest-options"
3958 \begin_layout Paragraph
3959 \begin_inset CommandInset label
3961 name "par:Unreliable-tests"
3968 \begin_layout Standard
3969 Test cases whose name matches a pattern in the file
3970 \begin_inset Flex Code
3973 \begin_layout Plain Layout
3974 development/autotests/unreliableTests
3986 \begin_layout Standard
3987 These tests are not executed using
3988 \begin_inset Flex Code
3991 \begin_layout Plain Layout
3998 \begin_inset Flex Code
4001 \begin_layout Plain Layout
4011 \begin_layout Standard
4012 They pass or fail for various reasons not related to LyX (nonstandard, erratic)
4013 or pass but should rather fail (wrong output).
4015 \begin_inset Note Note
4018 \begin_layout Plain Layout
4019 *invalid* tests (wrong output) are not *unreliable*.
4020 # Use "unfit" or "unapplicable" as better label and name of pattern file?
4029 \begin_layout Standard
4030 The following sublabels are currently present in
4031 \begin_inset Flex Code
4034 \begin_layout Plain Layout
4043 \begin_layout Description
4044 nonstandard Documents with additional requirements, e.g.
4045 a class or package file not in TeXLive.
4047 \begin_inset Note Note
4050 \begin_layout Plain Layout
4052 \begin_inset Quotes eld
4056 \begin_inset Quotes erd
4060 \begin_inset Quotes eld
4064 \begin_inset Quotes erd
4075 \begin_layout Description
4076 erratic Tests depending on local configuration or the phase of the moon.
4080 \begin_layout Description
4081 varying_versions Test depending on TeX distribution, package versions or
4085 \begin_layout Description
4087 \begin_inset space ~
4090 output Export does not fail but the resulting document has (undetected)
4095 \begin_layout Standard
4096 \paragraph_spacing single
4097 \begin_inset Note Note
4100 \begin_layout Plain Layout
4101 \paragraph_spacing single
4102 These tests are in a strict sense not unreliable but
4106 (not measuring what they should measure).
4115 \begin_layout Paragraph
4116 \begin_inset CommandInset label
4118 name "par:Export-test-filtering"
4122 Export test filtering
4125 \begin_layout Standard
4126 The assignment of a label to a test is controlled by a set of files with
4127 regular expressions that are matched against the test names.
4130 \begin_layout Description
4131 ignoredTests (small file)
4132 \begin_inset Newline newline
4135 Tests selected here are withdrawn in the configuration step (cf.
4137 \begin_inset CommandInset ref
4139 reference "par:Configuring-ctests"
4147 \begin_layout Labeling
4148 \labelwidthstring 00.00.0000
4149 Input Test of any export combination
4152 \begin_layout Labeling
4153 \labelwidthstring 00.00.0000
4154 Output Stop if tests not selected here
4158 \begin_layout Description
4159 unreliableTests: Tests selected pass or fail dependent on the system where
4161 Selected tests gain the label 'unreliable'.
4165 \begin_layout Labeling
4166 \labelwidthstring 00.00.0000
4167 Input Each test which passed 'ignoredTests'
4170 \begin_layout Labeling
4171 \labelwidthstring 00.00.0000
4172 Output Stop if test selected, gain label 'unreliable'.
4176 \begin_layout Description
4178 \begin_inset space \space{}
4185 \begin_layout Labeling
4186 \labelwidthstring 00.00.0000
4187 Input Each test which passed 'unreliableTests'
4190 \begin_layout Labeling
4191 \labelwidthstring 00.00.0000
4192 Output Stop if not selected, gain test-property 'WILL_FAIL' (i.e.
4193 tests are reported as failing if the export works without error.) If no
4194 subselection applies, gain labels 'export' and 'inverted'.
4197 \begin_layout Standard
4198 The following filter perfoms a subselection of 'invertedTests':
4201 \begin_layout Description
4202 suspendedTests Tests selected here gain the label 'suspended' but _not_
4203 'export' or 'inverted', although in ctest they remain inverted.
4204 ('ctest' knows only 'inverted' or not, labels are used only for test selection)
4208 \begin_layout Labeling
4209 \labelwidthstring 00.00.0000
4210 Input Each test selected by 'invertedTests'
4213 \begin_layout Labeling
4214 \labelwidthstring 00.00.0000
4215 Output Selected test gains label 'suspended'.
4221 \begin_layout Standard
4222 The following table may clarify label assignement
4225 \begin_layout Standard
4226 \begin_inset Tabular
4227 <lyxtabular version="3" rows="7" columns="9">
4228 <features tabularvalignment="middle">
4229 <column alignment="left" valignment="top" width="0pt">
4230 <column alignment="left" valignment="top" width="0pt">
4231 <column alignment="left" valignment="top" width="0pt">
4232 <column alignment="left" valignment="top" width="0pt">
4233 <column alignment="center" valignment="top">
4234 <column alignment="center" valignment="top">
4235 <column alignment="center" valignment="top">
4236 <column alignment="center" valignment="top">
4237 <column alignment="center" valignment="top">
4239 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4242 \begin_layout Plain Layout
4243 Test matching pattern in file:
4248 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4251 \begin_layout Plain Layout
4257 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4260 \begin_layout Plain Layout
4266 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4269 \begin_layout Plain Layout
4275 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4278 \begin_layout Plain Layout
4284 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4287 \begin_layout Plain Layout
4293 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4296 \begin_layout Plain Layout
4302 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4305 \begin_layout Plain Layout
4311 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4314 \begin_layout Plain Layout
4322 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4325 \begin_layout Plain Layout
4331 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4334 \begin_layout Plain Layout
4340 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4343 \begin_layout Plain Layout
4349 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4352 \begin_layout Plain Layout
4358 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4361 \begin_layout Plain Layout
4367 <cell alignment="center" valignment="top" topline="true" usebox="none">
4370 \begin_layout Plain Layout
4376 <cell alignment="center" valignment="top" topline="true" usebox="none">
4379 \begin_layout Plain Layout
4385 <cell alignment="center" valignment="top" topline="true" usebox="none">
4388 \begin_layout Plain Layout
4394 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4397 \begin_layout Plain Layout
4405 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4408 \begin_layout Plain Layout
4414 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4417 \begin_layout Plain Layout
4423 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4426 \begin_layout Plain Layout
4432 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4435 \begin_layout Plain Layout
4441 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4444 \begin_layout Plain Layout
4450 <cell alignment="center" valignment="top" topline="true" usebox="none">
4453 \begin_layout Plain Layout
4459 <cell alignment="center" valignment="top" topline="true" usebox="none">
4462 \begin_layout Plain Layout
4468 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4471 \begin_layout Plain Layout
4477 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4480 \begin_layout Plain Layout
4488 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4491 \begin_layout Plain Layout
4497 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4500 \begin_layout Plain Layout
4506 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4509 \begin_layout Plain Layout
4515 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4518 \begin_layout Plain Layout
4524 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4527 \begin_layout Plain Layout
4533 <cell alignment="center" valignment="top" topline="true" usebox="none">
4536 \begin_layout Plain Layout
4542 <cell alignment="center" valignment="top" topline="true" usebox="none">
4545 \begin_layout Plain Layout
4551 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4554 \begin_layout Plain Layout
4560 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4563 \begin_layout Plain Layout
4571 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
4574 \begin_layout Plain Layout
4580 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4583 \begin_layout Plain Layout
4589 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
4592 \begin_layout Plain Layout
4598 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4601 \begin_layout Plain Layout
4607 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4610 \begin_layout Plain Layout
4616 <cell alignment="center" valignment="top" topline="true" usebox="none">
4619 \begin_layout Plain Layout
4625 <cell alignment="center" valignment="top" topline="true" usebox="none">
4628 \begin_layout Plain Layout
4634 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4637 \begin_layout Plain Layout
4643 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4646 \begin_layout Plain Layout
4654 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4657 \begin_layout Plain Layout
4663 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4666 \begin_layout Plain Layout
4672 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4675 \begin_layout Plain Layout
4681 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4684 \begin_layout Plain Layout
4690 <cell alignment="center" valignment="top" topline="true" leftline="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" usebox="none">
4711 \begin_layout Plain Layout
4717 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4720 \begin_layout Plain Layout
4726 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
4729 \begin_layout Plain Layout
4737 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4740 \begin_layout Plain Layout
4746 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4749 \begin_layout Plain Layout
4755 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4758 \begin_layout Plain Layout
4764 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4767 \begin_layout Plain Layout
4773 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4776 \begin_layout Plain Layout
4782 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4785 \begin_layout Plain Layout
4791 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
4794 \begin_layout Plain Layout
4800 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4803 \begin_layout Plain Layout
4809 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
4812 \begin_layout Plain Layout
4826 \begin_layout Standard
4827 \begin_inset Note Note
4830 \begin_layout Plain Layout
4832 \begin_inset Quotes eld
4836 \begin_inset Quotes erd
4839 filter, this would be far less complicated:
4842 \begin_layout Plain Layout
4843 \begin_inset Tabular
4844 <lyxtabular version="3" rows="6" columns="7">
4845 <features tabularvalignment="middle">
4846 <column alignment="left" valignment="top" width="0pt">
4847 <column alignment="left" valignment="top" width="0pt">
4848 <column alignment="left" valignment="top" width="0pt">
4849 <column alignment="center" valignment="top">
4850 <column alignment="center" valignment="top">
4851 <column alignment="center" valignment="top">
4852 <column alignment="center" valignment="top">
4854 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4857 \begin_layout Plain Layout
4858 Test matching pattern in file:
4863 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4866 \begin_layout Plain Layout
4872 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
4875 \begin_layout Plain Layout
4881 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4884 \begin_layout Plain Layout
4890 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4893 \begin_layout Plain Layout
4899 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4902 \begin_layout Plain Layout
4908 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4911 \begin_layout Plain Layout
4919 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4922 \begin_layout Plain Layout
4928 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4931 \begin_layout Plain Layout
4937 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4940 \begin_layout Plain Layout
4946 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
4949 \begin_layout Plain Layout
4955 <cell alignment="center" valignment="top" topline="true" usebox="none">
4958 \begin_layout Plain Layout
4964 <cell alignment="center" valignment="top" topline="true" usebox="none">
4967 \begin_layout Plain Layout
4973 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
4976 \begin_layout Plain Layout
4984 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4987 \begin_layout Plain Layout
4993 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
4996 \begin_layout Plain Layout
5002 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5005 \begin_layout Plain Layout
5011 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
5014 \begin_layout Plain Layout
5020 <cell alignment="center" valignment="top" topline="true" usebox="none">
5023 \begin_layout Plain Layout
5029 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
5032 \begin_layout Plain Layout
5038 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
5041 \begin_layout Plain Layout
5049 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
5052 \begin_layout Plain Layout
5058 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5061 \begin_layout Plain Layout
5067 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5070 \begin_layout Plain Layout
5076 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
5079 \begin_layout Plain Layout
5085 <cell alignment="center" valignment="top" topline="true" usebox="none">
5088 \begin_layout Plain Layout
5094 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
5097 \begin_layout Plain Layout
5103 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
5106 \begin_layout Plain Layout
5114 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
5117 \begin_layout Plain Layout
5123 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
5126 \begin_layout Plain Layout
5132 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5135 \begin_layout Plain Layout
5141 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
5144 \begin_layout Plain Layout
5150 <cell alignment="center" valignment="top" topline="true" usebox="none">
5153 \begin_layout Plain Layout
5159 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
5162 \begin_layout Plain Layout
5168 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
5171 \begin_layout Plain Layout
5179 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5182 \begin_layout Plain Layout
5188 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5191 \begin_layout Plain Layout
5197 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5200 \begin_layout Plain Layout
5206 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
5209 \begin_layout Plain Layout
5215 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
5218 \begin_layout Plain Layout
5224 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
5227 \begin_layout Plain Layout
5233 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
5236 \begin_layout Plain Layout
5255 \begin_layout Subsubsection
5259 \begin_layout Standard
5260 These tests check whether a .lyx file loads without any terminal messages.
5261 They correspond to the manual operations of simply opening a .lyx file on
5262 the terminal, exiting LyX once the file is loaded, and then checking whether
5263 there is any output from the terminal.
5264 These tests are useful for catching malformed .lyx files and parsing bugs.
5265 They can also be used to find a .lyx file in which an instance of something
5267 To do this, compile LyX with a local patch that outputs something to the
5268 terminal when an instance is found, and then run the check_load tests to
5269 see if any fail, which would mean that the situation occurs in the LyX
5270 documentation files corresponding to the failed tests.
5271 These tests are expectedly fragile: any LyX diagnostic message, which is
5272 not necessarily an error, would cause the tests to fail.
5273 Similarly, any message output by a library (e.g.
5274 Qt) would also cause failure.
5275 There are some messages that the check_load tests are instructed to ignore,
5276 which are stored in the file
5277 \begin_inset Flex Code
5280 \begin_layout Plain Layout
5281 development/autotests/filterCheckWarnings
5289 \begin_layout Standard
5290 Under cmake, the tests are labeled as 'load'.
5293 \begin_layout Subsubsection
5297 \begin_layout Standard
5298 Automated tests based on the "MonKey Testing" keytest program are enabled
5299 if the necessary dependencies are found and if the CMake flag
5300 \begin_inset Flex Code
5303 \begin_layout Plain Layout
5304 -DLYX_ENABLE_KEYTESTS=ON
5310 They are documented in the README document in
5311 \begin_inset Flex Code
5314 \begin_layout Plain Layout
5315 development/autotests
5320 subfolder of the \SpecialChar LyX
5321 source code distribution.
5324 \begin_layout Subsubsection
5328 \begin_layout Standard
5329 These tests combine lyx2lyx tests with check_load tests.
5330 They fail if either fails.
5333 \begin_layout Subsubsection
5337 \begin_layout Standard
5338 The URL tests are enabled with the
5339 \begin_inset Flex Code
5342 \begin_layout Plain Layout
5343 -DLYX_ENABLE_URLTESTS=ON
5348 CMake flag and are useful for finding broken links in our documentation
5350 If a URL test fails, to see which link in particular was reported as broken,
5352 \begin_inset Flex Code
5355 \begin_layout Plain Layout
5362 These tests are extremely fragile (e.g.
5363 a test can depend on your Internet connection) and a failed URL test should
5364 not be taken too seriously.
5365 URL tests are labeled as
5370 \begin_layout Paragraph
5374 \begin_layout Standard
5375 cmake is required to run the \SpecialChar LyX
5376 tests, running them is not implemented for
5380 \begin_layout Standard
5381 The appropriate commands are:
5384 \begin_layout Itemize
5390 \begin_inset Newline newline
5393 runs all tests with label
5398 \begin_layout Itemize
5401 ctest -R 'check_.*urls'
5404 \begin_inset Newline newline
5407 runs the tests 'check_accessible_urls'
5410 \begin_layout Standard
5411 Associated test results can be examined in ctest-log directory in files
5412 of the form 'LastFailed.*URLS.log'
5415 \begin_layout Section
5416 Development policies
5419 \begin_layout Standard
5420 This chapter lists some guidelines that should be followed.
5421 This list is not complete, and many guidelines are in separate chapters,
5423 \begin_inset Quotes eld
5426 When is an update of the .lyx file format number needed?
5427 \begin_inset Quotes erd
5431 \begin_inset CommandInset ref
5433 reference "sec:When-is-an"
5440 \begin_layout Subsection
5441 When to set a fixed milestone?
5444 \begin_layout Standard
5445 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
5449 \begin_layout Enumerate
5450 Somebody is actively working on a fix.
5453 \begin_layout Enumerate
5454 The bug is so severe that it would block the release if it is not fixed.
5457 \begin_layout Standard
5458 If a bug is important, but nobody is working on it, and it is no showstopper,
5459 use a milestone like 2.1.x or 2.2.x.
5460 For all other bugs, do not set a milestone at all.
5463 \begin_layout Subsection
5464 Can we add rc entries in stable branch?
5467 \begin_layout Standard
5469 We are supposed to increase the prefs2prefs version number with such things.
5472 \begin_layout Section
5473 Documentation policies
5476 \begin_layout Subsection
5480 \begin_layout Standard
5482 \begin_inset space ~
5485 rules in editing the docs:
5488 \begin_layout Enumerate
5489 \begin_inset CommandInset label
5491 name "enu:If-you-are"
5495 If you are not the maintainer of a doc file or a chapter/section, you MUST
5496 use change tracking so that the maintainer could review your changes
5499 \begin_layout Enumerate
5500 Respect the formatting of the document.
5501 The different files use different formatting styles.
5502 That is OK and has historic reasons nobody fully knows ;-).
5503 But it is important to be consistent within one file.
5506 \begin_layout Enumerate
5507 All changes you make to a file in one language MUST also go the file in
5508 the other actively maintained languages.
5509 Normally the maintainer does this for you, if you are the maintainer, you
5510 must do this by copying or changing the changed or added text to the other
5511 files so that the translators sees the blue underlined text and know what
5512 they have to translate and what was changed.
5515 \begin_layout Enumerate
5516 You MUST assure that the document is compilable as
5517 \begin_inset Quotes eld
5521 \begin_inset Quotes erd
5524 or the document's default output format after your changes.
5527 \begin_layout Enumerate
5528 All fixes (typos, compilation fixes, updates info etc.) go at first into
5529 the current GIT branch because the user should benefit from all fixes with
5530 every minor release.
5531 Feel free to commit directly to branch as long as you follow rule
5532 \begin_inset space ~
5536 \begin_inset CommandInset ref
5538 reference "enu:If-you-are"
5543 You can immediately commit to master as well.
5546 \begin_layout Enumerate
5547 The fileformat of a file must not be changed unless you document a new feature
5548 in LyX that requires a new fileformat.
5549 The reason for this rule is to keep it easy for the doc maintainers to
5550 port/backport changes to from master/branch.
5553 \begin_layout Standard
5554 The main documentation consists of these files:
5557 \begin_layout Description
5558 splash.lyx it is the first file you see after an installation.
5559 We assume that a new user sees this.
5560 It is therefore designed to be as simple as possible.
5561 Therefore please don't add any new formatting, only fix typos etc.
5562 Splash.lyx is up to date for \SpecialChar LyX
5563 2.1.x, currently maintained by Uwe Stöhr.
5566 \begin_layout Description
5567 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
5569 It therefore uses a limited set of formatting.
5570 For example a standard document class.
5571 Since new users will first learn about the formatting possibilities of
5573 please keep this file that simple.
5574 Intro.lyx is up to date for \SpecialChar LyX
5575 2.1.x, currently maintained by Uwe Stöhr.
5578 \begin_layout Description
5579 Tutorial.lyx our tutorial.
5580 It must be always up to date.
5581 Normally there is nothing to add since we don't want to overwhelm new users
5582 with too much details.
5583 The will learn these details while using \SpecialChar LyX
5584 and we have special manuals.
5585 Tutorial.lyx is up to date for \SpecialChar LyX
5586 2.1.x, currently maintained by Uwe Stöhr.
5589 \begin_layout Description
5590 UserGuide.lyx our main user guide.
5591 It covers a mixture of basic and detailed information.
5592 Some information is also in the Math and EmbeddedObjects manual so that
5593 the UserGuide refers to these files.
5594 UserGuide.lyx is up to date for \SpecialChar LyX
5595 2.1.x, currently maintained by Uwe Stöhr.
5598 \begin_layout Description
5599 EmbeddedObjects.lyx a special manual to explain things like tables floats
5602 EmbeddedObjects.lyx is up to date for \SpecialChar LyX
5603 2.1.x, currently maintained by Uwe
5607 \begin_layout Description
5608 Math.lyx a special manual to explain everything regarding math in all detail.
5609 Math.lyx is up to date for \SpecialChar LyX
5610 2.1.x, currently maintained by Uwe Stöhr.
5613 \begin_layout Description
5614 Additional.lyx this manual covers information that would be too much detail
5615 for the UserGuide or would make the UserGuide uncompilable or only compilable
5616 when installing a lot of special \SpecialChar LaTeX
5618 What should be in the UserGuide or better in Additional is a matter of
5620 it is up to you to decide that.
5621 Additional.lyx is not completely up to date for \SpecialChar LyX
5624 \begin_inset space ~
5627 8 is up to date and currently maintained by Uwe Stöhr.
5628 It certainly needs a rewrite and update.
5629 For example many info in chapter
5630 \begin_inset space ~
5633 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
5637 \begin_layout Description
5638 Customization.lyx this manual covers information how to customize \SpecialChar LyX
5640 output formats, operating systems, languages etc.
5641 It is currently completely out of date and needs a major rewrite and update.
5642 If you do this please assure that your information are given for all OSes
5643 and \SpecialChar LaTeX
5644 distributions (meaning be as objective as possible).