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 want to use \SpecialChar LyX
165 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.
172 \begin_layout Section
176 \begin_layout Standard
178 uses several custom file formats for configuration files and documents.
179 This chapter contains some background concerning these file formats.
180 Several file formats are also described in detail in the regular user documenta
184 \begin_layout Subsection
188 \begin_layout Subsection
189 When is an update of the .lyx file format number needed?
190 \begin_inset CommandInset label
192 name "sec:When-is-an"
199 \begin_layout Standard
200 When you are working on a new feature you may ask yourself whether it needs
201 an update of the .lyx file format number.
202 Whether an update is needed or not is not always obvious.
203 Below you can find a list of reasons for file format updates with explanations:
206 \begin_layout Description
215 setting Whenever you introduce a new setting that is stored in the document
216 header, a file format update is needed.
217 This is also true if you add a new valid value to an existing setting,
219 \begin_inset space \thinspace{}
223 \begin_inset space \space{}
226 a new language that is stored in
227 \begin_inset Flex Code
230 \begin_layout Plain Layout
241 \begin_layout Description
250 setting If a certain setting becomes obsolete and gets removed, a file format
254 \begin_layout Description
259 inset Of course a new inset requires a file format update.
262 \begin_layout Description
267 style in any layout file or module shipped with \SpecialChar LyX
268 , or new shipped layout
270 These requirements are currently under discussion and might change in the
274 \begin_layout Description
287 package Any new math package that is automatically loaded needs a file format
289 The reason for this is that there is no true ERT inset for math formulas:
290 Each command is parsed, and if a user happens to define a local command
291 with the same name as a command that triggers an automatic load of a package,
292 he needs to be able to switch off the automatic loading of that package.
293 This switch is stored by the
294 \begin_inset Flex Code
297 \begin_layout Plain Layout
306 \begin_layout Standard
307 If you are still unsure, please ask on the development list.
310 \begin_layout Subsection
311 How to update the file format number of .lyx files
312 \begin_inset CommandInset label
314 name "subsec:update_lyx_files"
321 \begin_layout Standard
322 Once you came to the conclusion that a file format update is needed you
323 should use the following procedure to perform the update:
326 \begin_layout Enumerate
327 Implement and test the new feature, including the reading and writing of
329 Note that any file produced at this stage does not use a valid format,
330 so do not use this version of \SpecialChar LyX
331 for working on any important documents.
334 \begin_layout Enumerate
335 \begin_inset CommandInset label
337 name "enu:Describe_format"
341 Describe the new format in
342 \begin_inset Flex Code
345 \begin_layout Plain Layout
354 \begin_layout Enumerate
355 Update the \SpecialChar LyX
356 file format number in
357 \begin_inset Flex Code
360 \begin_layout Plain Layout
369 \begin_layout Enumerate
370 Update the range of file formats in the array
371 \begin_inset Flex Code
374 \begin_layout Plain Layout
381 \begin_inset Flex Code
384 \begin_layout Plain Layout
393 \begin_layout Enumerate
394 \begin_inset CommandInset label
396 name "enu:Add-an-entry"
400 Add an entry to both format lists (for conversion and reversion) in
401 \begin_inset Newline newline
405 \begin_inset Flex Code
408 \begin_layout Plain Layout
409 lib/lyx2lyx/lyx_2_2.py
415 Add a conversion routine if needed (e.
416 \begin_inset space \thinspace{}
420 \begin_inset space \space{}
423 a new header setting always needs a conversion that adds the new setting,
424 a new document language does not need one).
425 Add a reversion routine if needed.
426 While the conversion routine is required to produce a document that is
427 equivalent to the old version, the requirements of the reversion are not
429 If possible, try to produce a proper reversion, using ERT if needed, but
430 for some features this might be too complicated.
431 In this case, the minimum requirement of the reversion routine is that
432 it produces a valid document which can be read by an older \SpecialChar LyX
434 If absolutely needed, even data loss is allowed for the reversion.
437 \begin_layout Enumerate
438 Since tex2lyx has several implicit file format dependencies caused by sharing
439 code with \SpecialChar LyX
440 , updating the file format of .lyx files produced by tex2lyx at
441 the same time as updating the main .lyx file format is strongly recommended.
442 Therefore, a compiler warning will be issued if the \SpecialChar LyX
443 and tex2lyx .lyx file
444 format numbers differ.
445 In many cases the tex2lyx update requires only the first and last item
447 \begin_inset Separator parbreak
454 \begin_layout Enumerate
455 Update the tex2lyx file format number in
456 \begin_inset Flex Code
459 \begin_layout Plain Layout
468 \begin_layout Enumerate
469 If the lyx2lyx conversion from the old to the new format is empty, or if
470 tex2lyx does not yet output the changed feature, you do not need any further
472 Otherwise, search for the changed feature in tex2lyx, and adjust the output
473 according to the lyx2lyx changes.
476 \begin_layout Enumerate
477 Update the tex2lyx test references as described in
478 \begin_inset CommandInset ref
479 LatexCommand formatted
480 reference "sec:Updating-test-references"
488 \begin_layout Enumerate
489 If you did not implement full tex2lyx support of the new feature, add a
491 \begin_inset Flex Code
494 \begin_layout Plain Layout
500 describing the missing bits.
501 Note that it is perfectly fine if you do not add full tex2lyx support for
502 a new feature: The updating recommendation above is only issued for the
503 syntax of the produced .lyx file.
504 It is no problem if some features supported by \SpecialChar LyX
505 are still output as ERT
506 by tex2lyx, since the problems in the past that resulted in the update
507 recommendation were related to mixed version syntax, not ERT.
510 \begin_layout Enumerate
511 It would be nice if you could create a .lyx test file which contains instances
512 of all changed or added features.
513 This could then be used to test lyx2lyx and tex2lyx.
514 Unfortunately it has not yet been decided how to collect such examples,
515 so please ask on the development list if you want to create one.
518 \begin_layout Enumerate
519 \begin_inset CommandInset label
521 name "enu:updatefiles"
525 Update LyX's .lyx documentation files to the new format.
526 The developer who makes the change knows best what changes to expect when
527 inspecting the resulting diff.
528 Because of this, you might be able to catch a bug in the lyx2lyx code that
529 updates the format just by taking a quick scan through the large diff that
531 \begin_inset Note Note
534 \begin_layout Plain Layout
535 Another advantage is that if later we suspect a bug in lyx2lyx we can easily
536 see which layout update made an unexpected change by looking at the git
537 log of a .lyx file that suffers the problem.
543 To do this, first make sure that there are no changes to the git repository
544 that you will not want to commit (this is needed because it will be convenient
545 to commit with the command
546 \begin_inset Flex Code
549 \begin_layout Plain Layout
556 Then run the following command in the root folder of the source:
557 \begin_inset Flex Code
560 \begin_layout Plain Layout
561 python development/tools/updatedocs.py
567 Look at the resulting changes using the command
568 \begin_inset Flex Code
571 \begin_layout Plain Layout
578 If anything looks surprising, please investigate.
579 Keep in mind that the case of
580 \begin_inset Flex Code
583 \begin_layout Plain Layout
589 is special, because it is first generated with
590 \begin_inset Flex Code
593 \begin_layout Plain Layout
599 before being converted to the latest format.
600 Finally, commit using
601 \begin_inset Flex Code
604 \begin_layout Plain Layout
613 \begin_layout Subsection
614 Updating the file format number of layout files
617 \begin_layout Standard
619 \begin_inset CommandInset ref
621 reference "enu:updatefiles"
626 \begin_inset CommandInset ref
628 reference "subsec:update_lyx_files"
633 \begin_inset Flex Code
636 \begin_layout Plain Layout
642 command, use this command:
643 \begin_inset Flex Code
646 \begin_layout Plain Layout
647 python development/tools/updatelayouts.py
655 \begin_layout Standard
656 Note that we do not update the local layout of our
657 \begin_inset Flex Code
660 \begin_layout Plain Layout
666 files because users would then not be able to export to older formats.
667 For example, if a 2.2.0 user exported a template to 2.1.x format and tried
668 to open the file in LyX 2.1.x, there would be an error because the file would
669 contain a local layout whose format is too new.
670 The root reason for this is that we do not support converting layouts to
671 older layout formats, as we do for the
672 \begin_inset Flex Code
675 \begin_layout Plain Layout
684 \begin_layout Subsection
685 Updating the file format number of bind/ui files
688 \begin_layout Standard
689 A change to the functionality of existing LFUNs can require a conversion
691 \begin_inset Flex Code
694 \begin_layout Plain Layout
701 \begin_inset Flex Code
704 \begin_layout Plain Layout
710 files, and therefore an increment of the LFUN format, as well as a conversion
712 \begin_inset Flex Code
715 \begin_layout Plain Layout
722 The latter cannot be done automatically and requires also a \SpecialChar LyX
725 someone who might have made a set of \SpecialChar LyX
726 teaching manuals for use in their
731 \begin_layout Plain Layout
732 \begin_inset Flex URL
735 \begin_layout Plain Layout
737 http://www.lyx.org/trac/ticket/9794
750 \begin_layout Enumerate
751 Increment the LFUN file format number in
752 \begin_inset Flex Code
755 \begin_layout Plain Layout
764 \begin_layout Enumerate
765 Implement the LFUN conversion in
766 \begin_inset Flex Code
769 \begin_layout Plain Layout
770 lib/scripts/prefs2prefs_lfuns.py
778 \begin_layout Enumerate
780 \begin_inset CommandInset ref
782 reference "enu:updatefiles"
787 \begin_inset CommandInset ref
789 reference "subsec:update_lyx_files"
794 \begin_inset Flex Code
797 \begin_layout Plain Layout
803 command, use this command:
804 \begin_inset Flex Code
807 \begin_layout Plain Layout
808 bash development/tools/updatelfuns.sh
816 \begin_layout Enumerate
817 Update Info insets in
818 \begin_inset Flex Code
821 \begin_layout Plain Layout
828 To do so, increment the \SpecialChar LyX
829 format and proceed as in
830 \begin_inset CommandInset ref
832 reference "subsec:update_lyx_files"
837 \begin_inset CommandInset ref
839 reference "enu:Describe_format"
844 \begin_inset CommandInset ref
846 reference "enu:updatefiles"
851 In the lyx2lyx implementation (
852 \begin_inset CommandInset ref
854 reference "enu:Add-an-entry"
858 th step), implement a conversion similar to the one in
859 \begin_inset Flex Code
862 \begin_layout Plain Layout
868 above, as well as a corresponding reversion; for this one can use
869 \begin_inset Flex Code
872 \begin_layout Plain Layout
879 \begin_inset Flex Code
882 \begin_layout Plain Layout
883 lib/lyx2lyx/lyx2lyx_tools.py
892 \begin_layout Subsection
893 Backporting new styles to the stable version
896 \begin_layout Standard
897 Starting with the stable \SpecialChar LyX
898 2.1 branch, there is a mechanism in place to backport
899 new styles to the stable version without the need to update the file format.
900 The basic idea is that the new style definition is automatically copied
901 to the document preamble, so that it can even be used by older minor revisions
902 that did not yet include the style.
903 To backport a new style to the stable version, the following steps are
907 \begin_layout Enumerate
909 \begin_inset Flex Code
912 \begin_layout Plain Layout
918 to the style definition in the development version.
921 \begin_layout Enumerate
922 Copy the style definition to the stable version, but use
923 \begin_inset Flex Code
926 \begin_layout Plain Layout
933 If needed adjust the format to the one used by the stable version (see
934 the customization manual for details of the layout file format).
937 \begin_layout Enumerate
938 For each update of the style in a later stable version, increase the argument
940 \begin_inset Flex Code
943 \begin_layout Plain Layout
949 by one (in the stable version, the development version should not be touched).
952 \begin_layout Standard
953 For details about the
954 \begin_inset Flex Code
957 \begin_layout Plain Layout
963 flag see the customization manual.
965 \begin_inset Flex Code
968 \begin_layout Plain Layout
974 support is needed for backported styles: Since the style of the development
975 version has an infinite version number, it will always be used.
976 Furthermore, since its version number is less than one, the style will
977 not be written anymore to the document header for files saved by the new
981 \begin_layout Standard
982 \begin_inset Newpage newpage
988 \begin_layout Section
992 \begin_layout Standard
993 Automated tests are an important tool to detect bugs and regressions in
994 software development.
995 Some projects like gcc even require each bug fix to be accompanied by a
996 test case for the automatic test suite, that would detect this bug.
997 Testing interactive features automatically is of course very hard, but
998 core functionality like document import and export can be tested quite
999 easily, and some tests of this kind exist.
1002 \begin_layout Subsection
1006 \begin_layout Standard
1007 There are attempts to set up a suite of unit tests for LyX.
1010 \begin_layout Standard
1011 TODO: describe what is done and what is still to do.
1014 \begin_layout Subsection
1018 \begin_layout Standard
1019 The tex2lyx tests are located in the
1020 \begin_inset Flex Code
1023 \begin_layout Plain Layout
1029 subfolder of the \SpecialChar LyX
1030 source code distribution.
1031 The actual testing is performed by the simple python script
1032 \begin_inset Flex Code
1035 \begin_layout Plain Layout
1036 src/tex2lyx/test/runtests.py
1042 Each test consists of two files:
1043 \begin_inset Flex Code
1046 \begin_layout Plain Layout
1052 contains the \SpecialChar LaTeX
1053 code that should be tested.
1055 \begin_inset Flex Code
1058 \begin_layout Plain Layout
1064 contains the expected output of tex2lyx.
1065 When a test is run, the actual produced output is compared with the stored
1067 The test passes if both are identical.
1068 The test machinery is also able to generate a file
1069 \begin_inset Flex Code
1072 \begin_layout Plain Layout
1078 by exporting the produced .lyx file with \SpecialChar LyX
1080 This may be useful for roundtrip comparisons.
1083 \begin_layout Subsubsection
1087 \begin_layout Standard
1088 The tex2lyx tests can be run in several ways.
1090 \begin_inset Flex Code
1093 \begin_layout Plain Layout
1099 subfolder of the build directory, the commands
1100 \begin_inset Flex Code
1103 \begin_layout Plain Layout
1109 (cmake, all platforms),
1110 \begin_inset Flex Code
1113 \begin_layout Plain Layout
1119 (cmake, when using a make based build system and not MSVC) or
1120 \begin_inset Flex Code
1123 \begin_layout Plain Layout
1129 (autotools) will run the tex2lyx tests.
1130 Alternatively, in the root of the build directory, the command
1131 \begin_inset Flex Code
1134 \begin_layout Plain Layout
1140 runs all tests whose names match the regex
1141 \begin_inset Quotes eld
1145 \begin_inset Quotes erd
1149 Another way to run the tex2lyx tests in the root build directory is to
1150 instead use the command
1151 \begin_inset Flex Code
1154 \begin_layout Plain Layout
1155 ctest -L '(cmplyx|roundtrip)'
1160 , which runs all tests categorized with the label
1161 \begin_inset Quotes eld
1165 \begin_inset Quotes erd
1169 \begin_inset Quotes eld
1173 \begin_inset Quotes erd
1177 If a test fails, the differences between the expected and actual results
1178 are output in unified diff format.
1181 \begin_layout Subsubsection
1182 Updating test references
1183 \begin_inset CommandInset label
1185 name "sec:Updating-test-references"
1192 \begin_layout Standard
1193 In some cases a changed tex2lyx output is not a test failure, but wanted,
1195 \begin_inset space \thinspace{}
1199 \begin_inset space \space{}
1202 if a tex2lyx bug was fixed, or a new feature was added.
1203 In these cases the stored references need to be updated.
1204 To do so if using autotools, call
1205 \begin_inset Flex Code
1208 \begin_layout Plain Layout
1215 \begin_inset Flex Code
1218 \begin_layout Plain Layout
1224 subdirectory of the build directory.
1225 If instead using CMake, call
1226 \begin_inset Flex Code
1229 \begin_layout Plain Layout
1230 make updatetex2lyxtests
1235 in the build directory or in the
1236 \begin_inset Flex Code
1239 \begin_layout Plain Layout
1245 subdirectory of the build directory.
1249 \begin_layout Plain Layout
1250 Note that this is a case where a make target in the build directory can
1251 affect the source directory, which might not be advisable.
1256 On Windows do the following:
1259 \begin_layout Itemize
1260 Assure that the path to the python.exe is in your system PATH variable.
1263 \begin_layout Itemize
1264 Double-click on the file
1265 \begin_inset Flex Code
1268 \begin_layout Plain Layout
1269 updatetex2lyxtests.vcxproj
1274 in the build directory or in the
1275 \begin_inset Flex Code
1278 \begin_layout Plain Layout
1284 subdirectory of your build directory.
1287 \begin_layout Itemize
1288 In the appearing MSVC program right-click on the project
1292 in the project explorer and chose
1299 \begin_layout Standard
1300 For convenience, these commands also produce re-exported roundtrip .lyx.tex
1302 Please examine the changed output carefully before committing the changed
1303 files to the repository: Since the test machinery does not do a roundtrip
1305 \begin_inset Formula $\Rightarrow$
1309 \begin_inset Formula $\Rightarrow$
1312 .tex, and does not compare the produced dvi or pdf output, it assumes that
1313 the stored .lyx reference produces correct output if processed by \SpecialChar LyX
1315 There is only one chance to detect wrong output: before committing a new
1317 Once it is committed, it is quite difficult to verify whether it is correct.
1320 \begin_layout Standard
1325 update the test references by opening them with \SpecialChar LyX
1326 or directly running lyx2lyx
1328 This would not work, since lyx2lyx and \SpecialChar LyX
1329 produce slightly different files
1330 regarding insignificant whitespace and line breaks.
1333 \begin_layout Subsubsection
1337 \begin_layout Standard
1338 In many cases tests for new features may be added to one of the existing
1339 test files, but sometimes this is not possible or not wanted.
1340 Then a new test file needs to be added:
1343 \begin_layout Enumerate
1345 \begin_inset Flex Code
1348 \begin_layout Plain Layout
1349 src/tex2lyx/test/<test name>.tex
1354 and run tex2lyx in roundtrip mode to produce the file
1355 \begin_inset Flex Code
1358 \begin_layout Plain Layout
1359 src/tex2lyx/test/<test name>.lyx.lyx
1365 This file will be the new reference.
1368 \begin_layout Enumerate
1369 Once you confirmed that the tex2lyx output is correct, add the new files
1370 to the corresponding lists in
1371 \begin_inset Flex Code
1374 \begin_layout Plain Layout
1375 src/tex2lyx/test/runtests.py
1381 \begin_inset Flex Code
1384 \begin_layout Plain Layout
1385 src/tex2lyx/Makefile.am
1391 \begin_inset Flex Code
1394 \begin_layout Plain Layout
1395 src/tex2lyx/test/CMakeLists.txt
1403 \begin_layout Enumerate
1404 Commit the changes to the repository, or send a patch to the development
1405 list and ask for committing if you do not have commit rights.
1408 \begin_layout Subsection
1409 ctest automatic tests
1412 \begin_layout Standard
1413 Some tests are located in the
1414 \begin_inset Flex Code
1417 \begin_layout Plain Layout
1418 development/autotests/
1423 subfolder of the \SpecialChar LyX
1424 source code distribution.
1429 \begin_layout Plain Layout
1430 The README document in this folder only describes the
1431 \begin_inset Quotes eld
1435 \begin_inset Quotes erd
1438 subset of autotests!
1446 \begin_layout Standard
1447 These tests can be run by the commands
1448 \begin_inset Flex Code
1451 \begin_layout Plain Layout
1461 (all platforms) or (when using a make based build system and not MSVC)
1463 \begin_inset Flex Code
1466 \begin_layout Plain Layout
1473 \begin_inset Flex Code
1476 \begin_layout Plain Layout
1487 The test logs are written to the
1488 \begin_inset Flex Code
1491 \begin_layout Plain Layout
1505 \begin_layout Subsubsection
1509 \begin_layout Standard
1510 The export tests are integration tests.
1511 They take longer to run and are more likely to break than the tex2lyx tests.
1512 Nevertheless, they have caught many regressions and without a better alternativ
1513 e it is important to keep them up-to-date and understand how they work.
1516 \begin_layout Standard
1518 \begin_inset Quotes eld
1522 \begin_inset Quotes erd
1525 documentation, template, and example documents.
1526 In addition, there are a number of dedicated sample documents in the
1527 \begin_inset Flex Code
1530 \begin_layout Plain Layout
1536 subfolder of the \SpecialChar LyX
1537 source code distribution.
1538 All samples are (after copying and eventual processing by scripts) exported
1539 to various output formats via the
1540 \begin_inset Flex Code
1543 \begin_layout Plain Layout
1549 command line option.
1550 The test checks for errors reported by LyX (However, error-free export
1551 is no guarantee for an error-free output document.)
1554 \begin_layout Paragraph
1555 Expectations of LyX developers
1558 \begin_layout Standard
1559 Because the export tests are integration tests and take a long time to run,
1560 LyX developers are rarely expected to run all of the tests.
1561 Here are some good practices to follow by developers:
1564 \begin_layout Itemize
1565 When making a non-trivial change to a .layout file, run the export and layout
1566 tests corresponding with that .layout file.
1569 \begin_layout Itemize
1570 When making non-trivial changes to a .lyx file, run the export tests correspondin
1571 g to that .lyx file.
1574 \begin_layout Itemize
1575 When making non-trivial changes to LyX's \SpecialChar LaTeX
1577 touching the encoding code or package handling code that you expect will
1578 change the exported \SpecialChar LaTeX
1583 \begin_layout Standard
1584 \paragraph_spacing single
1585 Consider running all of the export tests before and after your change.
1586 If there are differences, please reconcile these (i.e.
1587 fix the bug or fix the tests)
1592 Ask for help if you're not sure what to.
1595 \begin_layout Standard
1596 If you do not want to run the tests,
1599 \begin_layout Itemize
1600 post the patch on the list and others will run the tests and eventually
1604 \begin_layout Itemize
1605 commit, but be prepared to fix eventually arising problems or to revert
1606 the commit if there is no easy fix.
1610 \begin_layout Itemize
1611 Understand how to interpret test failures.
1612 If your commit is found to have broken a test, you should be able to interpret
1613 the test results when made aware of them.
1615 \begin_inset CommandInset ref
1617 reference "subsec:Interpreting-export-tests"
1624 \begin_layout Paragraph
1625 \begin_inset CommandInset label
1627 name "par:export-test-output-formats"
1634 \begin_layout Standard
1635 The following output formats are currently tested for each sample document
1637 \begin_inset CommandInset ref
1639 reference "par:Export-test-filtering"
1646 \begin_layout Labeling
1647 \labelwidthstring 00.00.0000
1652 \begin_layout Labeling
1653 \labelwidthstring 00.00.0000
1654 lyx16 LyX 1.6 file format (lyx2lyx)
1657 \begin_layout Labeling
1658 \labelwidthstring 00.00.0000
1659 lyx21 LyX 2.1 file format (lyx2lyx)
1662 \begin_layout Labeling
1663 \labelwidthstring 00.00.0000
1664 xhtml LyXHTML (native LyX HTML export)
1668 \begin_layout Labeling
1669 \labelwidthstring 00.00.0000
1671 \begin_inset space ~
1675 \begin_inset space ~
1682 \begin_layout Labeling
1683 \labelwidthstring pdf5msystemFM
1684 dvi DVI (8-bit latex)
1687 \begin_layout Labeling
1688 \labelwidthstring pdf5msystemFM
1689 dvi3_texF DVI (LuaTeX with 8-bit TeX fonts)
1692 \begin_layout Labeling
1693 \labelwidthstring pdf5msystemFM
1694 dvi3_systemF DVI (LuaTeX with Unicode fonts)
1697 \begin_layout Labeling
1698 \labelwidthstring pdf5msystemFM
1702 \begin_layout Labeling
1703 \labelwidthstring pdf5msystemFM
1704 pdf4_texF PDF (XeTeX with 8-bit TeX fonts)
1707 \begin_layout Labeling
1708 \labelwidthstring pdf5msystemFM
1709 pdf4_systemF PDF (XeTeX with Unicode fonts)
1712 \begin_layout Labeling
1713 \labelwidthstring pdf5msystemFM
1714 pdf5_texF PDF (LuaTeX with 8-bit TeX fonts)
1717 \begin_layout Labeling
1718 \labelwidthstring pdf5msystemFM
1719 pdf5_systemF PDF (LuaTeX with Unicode fonts)
1723 \begin_layout Labeling
1724 \labelwidthstring 00.00.0000
1726 \begin_inset space ~
1730 \begin_inset space ~
1734 \begin_inset space ~
1738 \begin_inset space ~
1745 \begin_layout Labeling
1746 \labelwidthstring pdf5msystemFM
1747 pdf DVI -> PS (dvips) -> PDF (ps2pdf)
1750 \begin_layout Labeling
1751 \labelwidthstring pdf5msystemFM
1752 pdf3 DVI -> PDF (dvipdfm)
1756 \begin_layout Labeling
1757 \labelwidthstring 00.00.0000
1759 \begin_inset space ~
1762 tested: (or only if set as default output format in the document source)
1766 \begin_layout Labeling
1767 \labelwidthstring pdf5msystemFM
1771 \begin_layout Labeling
1772 \labelwidthstring pdf5msystemFM
1773 luatex LaTeX (LuaTeX)
1776 \begin_layout Labeling
1777 \labelwidthstring pdf5msystemFM
1778 dviluatex LaTeX (dviluatex)
1781 \begin_layout Labeling
1782 \labelwidthstring pdf5msystemFM
1783 pdflatex LaTeX (pdflatex)
1786 \begin_layout Labeling
1787 \labelwidthstring pdf5msystemFM
1788 platex LaTeX (pLaTeX)
1791 \begin_layout Labeling
1792 \labelwidthstring pdf5msystemFM
1796 \begin_layout Labeling
1797 \labelwidthstring pdf5msystemFM
1798 eps3 EPS (encapsulated Postscript) (cropped)
1801 \begin_layout Labeling
1802 \labelwidthstring pdf5msystemFM
1803 ps DVI -> Postscript (dvips)
1806 \begin_layout Labeling
1807 \labelwidthstring pdf5msystemFM
1811 \begin_layout Labeling
1812 \labelwidthstring pdf5msystemFM
1813 text (nor text2, ..., text4)
1816 \begin_layout Labeling
1817 \labelwidthstring pdf5msystemFM
1821 \begin_layout Labeling
1822 \labelwidthstring pdf5msystemFM
1826 \begin_layout Labeling
1827 \labelwidthstring pdf5msystemFM
1831 \begin_layout Labeling
1832 \labelwidthstring pdf5msystemFM
1837 \begin_layout Paragraph
1838 \begin_inset CommandInset label
1840 name "par:Configuring-ctests"
1844 Configuring the tests
1847 \begin_layout Standard
1848 To enable the export autotests, add the
1849 \begin_inset Flex Code
1852 \begin_layout Plain Layout
1853 -DLYX_ENABLE_EXPORT_TESTS=ON
1862 \begin_layout Standard
1863 \begin_inset Flex Code
1866 \begin_layout Plain Layout
1867 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
1875 \begin_layout Standard
1877 This flag will increase the time for the cmake command by several seconds,
1878 mainly because of the process of inverting tests (see Section
1879 \begin_inset CommandInset ref
1881 reference "subsec:Interpreting-export-tests"
1888 \begin_layout Paragraph
1889 \begin_inset CommandInset label
1891 name "par:ctest-options"
1898 \begin_layout Standard
1899 To run all tests, in the build directory simply run the command
1900 \begin_inset Flex Code
1903 \begin_layout Plain Layout
1913 \begin_layout Standard
1914 To run only some of the tests, use command line options (see examples below):
1917 \begin_layout Labeling
1918 \labelwidthstring -R
1919 \begin_inset Flex Code
1922 \begin_layout Plain Layout
1928 Run only the tests whose names match the given regular expression.
1931 \begin_layout Labeling
1932 \labelwidthstring -R
1933 \begin_inset Flex Code
1936 \begin_layout Plain Layout
1942 Run only the tests whose labels match the given regular expression.
1943 A test may have more that one label.
1947 \begin_layout Labeling
1948 \labelwidthstring -R
1949 \begin_inset Flex Code
1952 \begin_layout Plain Layout
1958 Exclude the tests whose names match the given regular expression.
1961 \begin_layout Labeling
1962 \labelwidthstring -R
1963 \begin_inset Flex Code
1966 \begin_layout Plain Layout
1972 Exclude the tests whose labels match the given regular expression.
1973 Cannot be combined with
1974 \begin_inset Flex Code
1977 \begin_layout Plain Layout
1986 \begin_layout Standard
1987 The following options help to find good selection patterns:
1990 \begin_layout Labeling
1991 \labelwidthstring -R
1992 \begin_inset Flex Code
1995 \begin_layout Plain Layout
2001 List the tests that would be run but not actually run them.
2006 \begin_layout Standard
2007 Useful in conjunction with the -R, -L, -E and -LE options, e.g., if you want
2008 to know how many tests there are or whether your
2009 \begin_inset Flex Code
2012 \begin_layout Plain Layout
2018 regular expression did what you expected.
2022 \begin_layout Labeling
2023 \labelwidthstring -R
2024 \begin_inset Flex Code
2027 \begin_layout Plain Layout
2028 \SpecialChar nobreakdash
2029 \SpecialChar nobreakdash
2035 print the list of all labels associated with the test set.
2036 Can also be combined with -R, -L, -E, ...
2040 \begin_layout Standard
2041 Other useful options are:
2044 \begin_layout Labeling
2045 \labelwidthstring -R
2046 \begin_inset Flex Code
2049 \begin_layout Plain Layout
2055 Run the tests in parallel using the given number of jobs.
2059 \begin_layout Standard
2060 We are still working on getting the tests to run in parallel.
2061 However, when running the tests in parallel, sometimes tests fail that
2062 pass when run sequentially.
2063 A reasonable approach is to first run the tests in parallel and then run
2064 the failed tests sequentially.
2068 \begin_layout Standard
2069 For example, to run 8 jobs at a time:
2072 \begin_layout Standard
2073 \begin_inset Flex Code
2076 \begin_layout Plain Layout
2085 \begin_layout Standard
2086 \begin_inset Flex Code
2089 \begin_layout Plain Layout
2090 ctest \SpecialChar nobreakdash
2091 \SpecialChar nobreakdash
2100 \begin_layout Standard
2102 Note that some tests cannot be run in parallel.
2103 These tests are marked in the code with the
2104 \begin_inset Flex Code
2107 \begin_layout Plain Layout
2118 \begin_layout Labeling
2119 \labelwidthstring -R
2120 \begin_inset Flex Code
2123 \begin_layout Plain Layout
2124 \SpecialChar nobreakdash
2125 \SpecialChar nobreakdash
2131 Set a global timeout on all tests that do not already have a timeout set
2136 \begin_layout Standard
2137 There have been bugs in LyX and in \SpecialChar LaTeX
2138 which cause compilation to hang, and
2139 without a timeout a test might never stop (in one case there was even a
2141 If a test times out, the
2142 \begin_inset Flex Code
2145 \begin_layout Plain Layout
2151 command exits with error, but you can distinguish between a timed out test
2152 and a failed test in the output reported at the end of the
2153 \begin_inset Flex Code
2156 \begin_layout Plain Layout
2166 \begin_layout Standard
2168 \begin_inset Flex Code
2171 \begin_layout Plain Layout
2177 ) the full list of command line options.
2180 \begin_layout Paragraph
2184 \begin_layout Itemize
2185 run only the export tests:
2186 \begin_inset Flex Code
2189 \begin_layout Plain Layout
2198 \begin_layout Itemize
2200 \begin_inset Flex Code
2203 \begin_layout Plain Layout
2204 ctest -L "inverted|suspended"
2212 \begin_layout Itemize
2213 list all export tests which match any of the labelling patterns:
2214 \begin_inset Flex Code
2217 \begin_layout Plain Layout
2228 \begin_layout Itemize
2229 exclude rarely used output formats and post-processing tests
2230 \begin_inset Flex Code
2233 \begin_layout Plain Layout
2234 ctest -L export -E "_(texF|dvi3|pdf3?)"
2242 \begin_layout Paragraph
2243 \begin_inset CommandInset label
2245 name "subsec:Interpreting-export-tests"
2249 Interpreting the export test results
2252 \begin_layout Standard
2253 A test can fail for several reasons, not all of them bad.
2256 \begin_layout Enumerate
2257 A new or edited sample document may be incompatible with some output formats.
2260 \begin_layout Enumerate
2261 A dependency is not met (e.g.
2262 the \SpecialChar LaTeX
2264 One hint that this is the case is that the corresponding
2265 \begin_inset Flex Code
2268 \begin_layout Plain Layout
2274 test will likely also fail.
2277 \begin_layout Enumerate
2278 An inverted test fails to fail (i.e.
2279 export that previously failed now works).
2282 \begin_layout Enumerate
2283 An external dependency was updated (e.g.
2288 \begin_layout Enumerate
2289 A recent code change introduced a bug.
2292 \begin_layout Enumerate
2293 \begin_inset CommandInset label
2299 A change in a document exposed a previously unknown bug or an incompatibility
2300 with an export format (e.g.
2301 Lua\SpecialChar LaTeX
2305 \begin_layout Standard
2306 Because the .lyx files are exported in several formats, it is not surprising
2307 that many of the exports fail.
2308 This expectation of failure is addressed by
2309 \begin_inset Quotes eld
2313 \begin_inset Quotes erd
2316 the tests, that is, by marking the test as
2317 \begin_inset Quotes eld
2321 \begin_inset Quotes erd
2324 if the export exits with error and as
2325 \begin_inset Quotes eld
2329 \begin_inset Quotes erd
2332 if the export succeeds
2337 It follows that these expected failures will not show up as failed tests
2338 in the test results and thus will not pollute the
2339 \begin_inset Quotes eld
2343 \begin_inset Quotes erd
2347 If the export actually succeeds, then the test will fail.
2348 The purpose of this failure is to get your attention—something has changed,
2349 possibly for the better.
2352 \begin_layout Standard
2353 We try to document why a test is inverted or ignored.
2354 See the comment (prefixed with
2355 \begin_inset Flex Code
2358 \begin_layout Plain Layout
2364 ) above the block in which the test is listed as inverted or ignored in
2366 \begin_inset Flex Code
2369 \begin_layout Plain Layout
2370 development/autotests/suspiciousTests
2376 \begin_inset Flex Code
2379 \begin_layout Plain Layout
2380 development/autotests/unreliableTests
2386 \begin_inset Flex Code
2389 \begin_layout Plain Layout
2390 development/autotests/ignoredTests
2399 \begin_layout Standard
2400 A good question is why do we enable the tests for non-default formats? The
2401 answer is that if a non-default route is broken it is often because a bug
2402 was introduced in LyX and not because a document-specific change was made
2403 that is not supported by the route.
2404 In other words, there is a high signal/noise ratio in the export tests
2405 for some non-default formats.
2409 \begin_layout Standard
2410 When a test or several tests fail, consider checking the files in the
2411 \begin_inset Flex Code
2414 \begin_layout Plain Layout
2420 subdirectory of your build directory.
2421 In this subdirectory are three files: the file
2422 \begin_inset Flex Code
2425 \begin_layout Plain Layout
2431 simply lists the tests that failed on your last
2432 \begin_inset Flex Code
2435 \begin_layout Plain Layout
2442 \begin_inset Flex Code
2445 \begin_layout Plain Layout
2451 file contains the output from the tests (and often has details explaining
2452 why a test failed); and the
2453 \begin_inset Flex Code
2456 \begin_layout Plain Layout
2462 file lists the times that it took to run the tests.
2465 \begin_layout Paragraph
2466 What action should you take if a test fails?
2469 \begin_layout Standard
2470 \paragraph_spacing single
2471 It is always good to check manually why something fails and if it passes
2472 if the PDF output is good.
2475 \begin_layout Itemize
2476 Generally, if a change breaks compilation for the target format (for the
2477 manuals pdf2) without solving some important other issue,
2479 fix or revert the commit
2481 that led to failure.
2484 \begin_layout Itemize
2485 If it is not possible to (immediately) fix the failure but there are reasons
2486 not to revert the commit (e.g.
2487 it fixes another more important issue),
2491 the failing test case (see
2492 \begin_inset CommandInset ref
2494 reference "par:Inverted-tests"
2501 \begin_layout Itemize
2506 test case fails because the export now works,
2510 the test by removing the labeling pattern from
2511 \begin_inset Quotes eld
2515 \begin_inset Quotes erd
2519 \begin_inset CommandInset ref
2521 reference "par:Inverted-tests"
2528 \begin_layout Itemize
2529 If the export did not fail previously but led to wrong output (PDF, say),
2530 it is in fact an improvement when the test now fails, label it as
2531 \begin_inset Quotes eld
2534 unreliable:wrong:output
2535 \begin_inset Quotes erd
2539 \begin_inset CommandInset ref
2541 reference "par:Unreliable-tests"
2548 \begin_layout Paragraph
2549 \begin_inset CommandInset label
2551 name "par:Inverted-tests"
2558 \begin_layout Standard
2559 Test cases whose name matches a pattern in the file
2560 \begin_inset Flex Code
2563 \begin_layout Plain Layout
2564 development/autotests/suspiciousTests
2574 They get also the test property
2575 \begin_inset Flex Code
2578 \begin_layout Plain Layout
2585 they are reported as failing if the export works without error
2586 \begin_inset Flex URL
2589 \begin_layout Plain Layout
2591 https://cmake.org/cmake/help/v3.0/command/set_tests_properties.html
2599 \begin_layout Standard
2600 Add failing cases to this file, if they cannot be solved
2601 \begin_inset Quotes eld
2605 \begin_inset Quotes erd
2608 but it is expected that the export will work in a foreseeable future, e.g.
2609 low priority issues like failures to export to a non-target format (for
2610 the manuals everything except pdf2).
2613 \begin_layout Standard
2614 The following sublabels are currently present in
2615 \begin_inset Flex Code
2618 \begin_layout Plain Layout
2627 \begin_layout Description
2628 todo test failures that require attention:
2632 \begin_layout Itemize
2633 minor issues to explore and properly sort later,
2636 \begin_layout Itemize
2640 \begin_layout Itemize
2641 LyX bugs to report at trac (move pattern to section "lyxbugs" once done).
2645 \begin_layout Description
2646 lyxbugs LyX bugs with a Trac number.
2649 \begin_layout Description
2650 ert Export failures due to "raw" LaTeX use in ERT or preamble code.
2654 \begin_layout Standard
2655 "Wontfix" if demonstrating correct use and OK in the default output format.
2659 \begin_layout Description
2660 texissues Export fails due to LaTeX limitations like non-ASCII characters
2661 in verbatim or listings, incompatible packages, ...
2665 \begin_layout Standard
2666 "Wontfix" if documents demonstrate correct use in the default output format:
2669 \begin_layout Itemize
2670 If the source can be made more robust without becoming "hackish", fix the
2674 \begin_layout Itemize
2675 if LyX could be enhanced to care for a permanent TeX limitation, file a
2676 ticket at trac and add a pattern under lyxbugs,
2679 \begin_layout Itemize
2680 otherwise, add a pattern here.
2684 \begin_layout Description
2685 attic Documents in the attic.
2686 (Kept for reference and format conversion test.)
2689 \begin_layout Subparagraph
2693 \begin_layout Standard
2694 Test cases whose name additionally matches a pattern in the file
2695 \begin_inset Flex Code
2698 \begin_layout Plain Layout
2699 development/autotests/suspendedTests
2717 This means they are not executed using
2718 \begin_inset Flex Code
2721 \begin_layout Plain Layout
2728 \begin_inset Flex Code
2731 \begin_layout Plain Layout
2738 However, they also get the test property
2739 \begin_inset Flex Code
2742 \begin_layout Plain Layout
2749 they are reported as failing if the export works without error.
2750 From time to time they still have to be checked using
2751 \begin_inset Flex Code
2754 \begin_layout Plain Layout
2763 \begin_layout Standard
2764 These tests are suspended, because the export fails for known reasons which
2765 cannot ATM be resolved.
2766 But it is expected the reason might disappear in the future.
2767 Be it new TL or better handling in \SpecialChar LyX
2771 \begin_layout Standard
2772 For ctest commands without the
2773 \begin_inset Flex Code
2776 \begin_layout Plain Layout
2782 parameter nothing changes.
2783 Suspended or not, tests will be executed depending only on the selecting
2784 regular expression given to the ctest command (see
2785 \begin_inset CommandInset ref
2787 reference "par:ctest-options"
2794 \begin_layout Paragraph
2795 \begin_inset CommandInset label
2797 name "par:Unreliable-tests"
2804 \begin_layout Standard
2805 Test cases whose name matches a pattern in the file
2806 \begin_inset Flex Code
2809 \begin_layout Plain Layout
2810 development/autotests/unreliableTests
2822 \begin_layout Standard
2823 These tests are not executed using
2824 \begin_inset Flex Code
2827 \begin_layout Plain Layout
2834 \begin_inset Flex Code
2837 \begin_layout Plain Layout
2847 \begin_layout Standard
2848 They pass or fail for various reasons not related to LyX (nonstandard, erratic)
2849 or pass but should rather fail (wrong output).
2851 \begin_inset Note Note
2854 \begin_layout Plain Layout
2855 *invalid* tests (wrong output) are not *unreliable*.
2856 # Use "unfit" or "unapplicable" as better label and name of pattern file?
2865 \begin_layout Description
2866 nonstandard Documents with additional requirements, e.g.
2867 a class or package file not in TeXLive.
2869 \begin_inset Note Note
2872 \begin_layout Plain Layout
2873 TODO: rename to "extra"?
2882 \begin_layout Standard
2883 These tests are labeled as
2889 \begin_layout Description
2890 erratic Tests depending on local configuration, OS, TeX distribution, package
2891 versions, or the phase of the moon.
2893 \begin_inset Note Note
2896 \begin_layout Plain Layout
2901 only for the phase-of-moon dependency?
2910 \begin_layout Standard
2911 These tests are labeled as
2917 \begin_layout Description
2919 \begin_inset space ~
2922 output Export does not fail but the resulting document has errors.
2926 \begin_layout Standard
2927 \paragraph_spacing single
2928 \begin_inset Note Note
2931 \begin_layout Plain Layout
2932 \paragraph_spacing single
2933 These tests are actually not
2941 (not measuring what they should measure).
2950 \begin_layout Paragraph
2951 \begin_inset CommandInset label
2953 name "par:Export-test-filtering"
2957 Export test filtering
2960 \begin_layout Standard
2961 The assignment of a label to a test is controlled by a set of files with
2962 regular expressions that are matched against the test names.
2965 \begin_layout Description
2966 ignoredTests (small file)
2967 \begin_inset Newline newline
2970 Tests selected here are withdrawn in the configuration step (cf.
2972 \begin_inset CommandInset ref
2974 reference "par:Configuring-ctests"
2982 \begin_layout Labeling
2983 \labelwidthstring 00.00.0000
2984 Input Test of any export combination
2987 \begin_layout Labeling
2988 \labelwidthstring 00.00.0000
2989 Output Stop if tests not selected here
2993 \begin_layout Description
2994 unreliableTests: Tests selected either pass or fail, but that is dependent
2995 on the system where the test is run.
2996 Selected tests gain the label 'unreliable'.
3000 \begin_layout Labeling
3001 \labelwidthstring 00.00.0000
3002 Input Each test which passed 'ignoredTests'
3005 \begin_layout Labeling
3006 \labelwidthstring 00.00.0000
3007 Output Stop if test selected, gain label 'unreliable'.
3011 \begin_layout Description
3013 \begin_inset space \space{}
3020 \begin_layout Labeling
3021 \labelwidthstring 00.00.0000
3022 Input Each test which passed 'unreliableTests'
3025 \begin_layout Labeling
3026 \labelwidthstring 00.00.0000
3027 Output Stop if not selected.
3030 \begin_layout Standard
3031 The following file is meant as subselections of 'suspiciousTests'.
3032 If neither subselection applies, test gains labels 'export' and 'inverted'
3035 \begin_layout Description
3036 suspendedTests Tests selected here gain the label 'suspended' but _not_
3037 'export' or 'inverted', although in ctest they remain inverted.
3038 ('ctest' knows only 'inverted' or not, labels are used only for test selection)
3042 \begin_layout Labeling
3043 \labelwidthstring 00.00.0000
3044 Input Each test selected by 'suspiciousTests'
3047 \begin_layout Labeling
3048 \labelwidthstring 00.00.0000
3049 Output Selected test gains label 'suspended'.
3055 \begin_layout Standard
3056 The following table may clarify label assignement
3059 \begin_layout Standard
3060 \begin_inset Tabular
3061 <lyxtabular version="3" rows="7" columns="12">
3062 <features tabularvalignment="middle">
3063 <column alignment="left" valignment="top" width="0pt">
3064 <column alignment="left" valignment="top" width="0pt">
3065 <column alignment="left" valignment="top" width="0pt">
3066 <column alignment="left" valignment="top" width="0pt">
3067 <column alignment="center" valignment="top">
3068 <column alignment="center" valignment="top">
3069 <column alignment="center" valignment="top">
3070 <column alignment="center" valignment="top">
3071 <column alignment="center" valignment="top">
3072 <column alignment="center" valignment="top">
3073 <column alignment="center" valignment="top">
3074 <column alignment="center" valignment="top">
3076 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3079 \begin_layout Plain Layout
3085 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3088 \begin_layout Plain Layout
3094 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3097 \begin_layout Plain Layout
3103 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3106 \begin_layout Plain Layout
3112 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3115 \begin_layout Plain Layout
3116 Marked in ctest, Assigned label
3121 <cell multicolumn="2" alignment="center" valignment="top" usebox="none">
3124 \begin_layout Plain Layout
3130 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3133 \begin_layout Plain Layout
3139 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3142 \begin_layout Plain Layout
3148 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3151 \begin_layout Plain Layout
3157 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3160 \begin_layout Plain Layout
3166 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3169 \begin_layout Plain Layout
3175 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3178 \begin_layout Plain Layout
3186 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3189 \begin_layout Plain Layout
3195 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3198 \begin_layout Plain Layout
3204 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3207 \begin_layout Plain Layout
3213 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3216 \begin_layout Plain Layout
3222 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3225 \begin_layout Plain Layout
3231 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
3234 \begin_layout Plain Layout
3240 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3243 \begin_layout Plain Layout
3249 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
3252 \begin_layout Plain Layout
3258 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3261 \begin_layout Plain Layout
3267 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
3270 \begin_layout Plain Layout
3276 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
3279 \begin_layout Plain Layout
3285 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3288 \begin_layout Plain Layout
3296 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3299 \begin_layout Plain Layout
3305 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3308 \begin_layout Plain Layout
3314 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3317 \begin_layout Plain Layout
3323 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3326 \begin_layout Plain Layout
3332 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3335 \begin_layout Plain Layout
3341 <cell alignment="center" valignment="top" topline="true" usebox="none">
3344 \begin_layout Plain Layout
3350 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3353 \begin_layout Plain Layout
3359 <cell alignment="center" valignment="top" topline="true" usebox="none">
3362 \begin_layout Plain Layout
3368 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3371 \begin_layout Plain Layout
3377 <cell alignment="center" valignment="top" topline="true" usebox="none">
3380 \begin_layout Plain Layout
3386 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3389 \begin_layout Plain Layout
3395 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3398 \begin_layout Plain Layout
3406 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3409 \begin_layout Plain Layout
3415 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3418 \begin_layout Plain Layout
3424 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3427 \begin_layout Plain Layout
3433 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3436 \begin_layout Plain Layout
3442 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3445 \begin_layout Plain Layout
3451 <cell alignment="center" valignment="top" topline="true" usebox="none">
3454 \begin_layout Plain Layout
3460 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3463 \begin_layout Plain Layout
3469 <cell alignment="center" valignment="top" topline="true" usebox="none">
3472 \begin_layout Plain Layout
3478 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3481 \begin_layout Plain Layout
3487 <cell alignment="center" valignment="top" topline="true" usebox="none">
3490 \begin_layout Plain Layout
3496 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3499 \begin_layout Plain Layout
3505 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3508 \begin_layout Plain Layout
3516 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
3519 \begin_layout Plain Layout
3525 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3528 \begin_layout Plain Layout
3534 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
3537 \begin_layout Plain Layout
3543 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3546 \begin_layout Plain Layout
3552 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3555 \begin_layout Plain Layout
3561 <cell alignment="center" valignment="top" topline="true" usebox="none">
3564 \begin_layout Plain Layout
3570 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3573 \begin_layout Plain Layout
3579 <cell alignment="center" valignment="top" topline="true" usebox="none">
3582 \begin_layout Plain Layout
3588 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3591 \begin_layout Plain Layout
3597 <cell alignment="center" valignment="top" topline="true" usebox="none">
3600 \begin_layout Plain Layout
3606 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3609 \begin_layout Plain Layout
3615 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3618 \begin_layout Plain Layout
3626 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3629 \begin_layout Plain Layout
3635 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3638 \begin_layout Plain Layout
3644 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3647 \begin_layout Plain Layout
3653 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3656 \begin_layout Plain Layout
3662 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3665 \begin_layout Plain Layout
3671 <cell alignment="center" valignment="top" topline="true" usebox="none">
3674 \begin_layout Plain Layout
3680 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3683 \begin_layout Plain Layout
3689 <cell alignment="center" valignment="top" topline="true" usebox="none">
3692 \begin_layout Plain Layout
3698 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3701 \begin_layout Plain Layout
3707 <cell alignment="center" valignment="top" topline="true" usebox="none">
3710 \begin_layout Plain Layout
3716 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3719 \begin_layout Plain Layout
3725 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3728 \begin_layout Plain Layout
3736 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3739 \begin_layout Plain Layout
3745 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3748 \begin_layout Plain Layout
3754 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3757 \begin_layout Plain Layout
3763 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3766 \begin_layout Plain Layout
3772 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3775 \begin_layout Plain Layout
3781 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3784 \begin_layout Plain Layout
3790 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3793 \begin_layout Plain Layout
3799 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3802 \begin_layout Plain Layout
3808 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3811 \begin_layout Plain Layout
3817 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3820 \begin_layout Plain Layout
3826 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3829 \begin_layout Plain Layout
3835 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
3838 \begin_layout Plain Layout
3852 \begin_layout Subsubsection
3856 \begin_layout Standard
3857 These tests check whether a .lyx file loads without any terminal messages.
3858 They correspond to the manual operations of simply opening a .lyx file on
3859 the terminal, exiting LyX once the file is loaded, and then checking whether
3860 there is any output from the terminal.
3861 These tests are useful for catching malformed .lyx files and parsing bugs.
3862 They can also be used to find a .lyx file in which an instance of something
3864 To do this, compile LyX with a local patch that outputs something to the
3865 terminal when an instance is found, and then run the check_load tests to
3866 see if any fail, which would mean that the situation occurs in the LyX
3867 documentation files corresponding to the failed tests.
3868 These tests are expectedly fragile: any LyX diagnostic message, which is
3869 not necessarily an error, would cause the tests to fail.
3870 Similarly, any message output by a library (e.g.
3871 Qt) would also cause failure.
3872 There are some messages that the check_load tests are instructed to ignore,
3873 which are stored in the file
3874 \begin_inset Flex Code
3877 \begin_layout Plain Layout
3878 development/autotests/filterCheckWarnings
3886 \begin_layout Standard
3887 Under cmake, the tests are labeled as 'load'.
3890 \begin_layout Subsubsection
3894 \begin_layout Standard
3895 Automated tests based on the "MonKey Testing" keytest program.
3896 They are documented in the README document in
3897 \begin_inset Flex Code
3900 \begin_layout Plain Layout
3901 development/autotests
3906 subfolder of the \SpecialChar LyX
3907 source code distribution.
3911 \begin_layout Subsubsection
3915 \begin_layout Standard
3916 These tests combine lyx2lyx tests with check_load tests.
3917 They fail if either fails.
3920 \begin_layout Subsubsection
3924 \begin_layout Standard
3925 The URL tests are enabled with the
3926 \begin_inset Flex Code
3929 \begin_layout Plain Layout
3930 -DLYX_ENABLE_URLTESTS=ON
3935 CMake flag and are useful for finding broken links in our documentation
3937 If a URL test fails, to see which link in particular was reported as broken,
3939 \begin_inset Flex Code
3942 \begin_layout Plain Layout
3949 These tests are extremely fragile (e.g.
3950 a test can depend on your Internet connection) and a failed URL test should
3951 not be taken too seriously.
3952 URL tests are labeled as
3957 \begin_layout Paragraph
3961 \begin_layout Standard
3962 cmake is required to run the \SpecialChar LyX
3963 tests, running them is not implemented for
3967 \begin_layout Standard
3968 The appropriate commands are:
3971 \begin_layout Itemize
3977 \begin_inset Newline newline
3980 runs all tests with label
3985 \begin_layout Itemize
3988 ctest -R 'check_.*urls'
3991 \begin_inset Newline newline
3994 runs the tests 'check_accessible_urls'
3997 \begin_layout Standard
3998 Associated test results can be examined in ctest-log directory in files
3999 of the form 'LastFailed.*URLS.log'
4002 \begin_layout Section
4003 Development policies
4006 \begin_layout Standard
4007 This chapter lists some guidelines that should be followed.
4008 This list is not complete, and many guidelines are in separate chapters,
4010 \begin_inset Quotes eld
4013 When is an update of the .lyx file format number needed?
4014 \begin_inset Quotes erd
4018 \begin_inset CommandInset ref
4020 reference "sec:When-is-an"
4027 \begin_layout Subsection
4028 When to set a fixed milestone?
4031 \begin_layout Standard
4032 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
4036 \begin_layout Enumerate
4037 Somebody is actively working on a fix.
4040 \begin_layout Enumerate
4041 The bug is so severe that it would block the release if it is not fixed.
4044 \begin_layout Standard
4045 If a bug is important, but nobody is working on it, and it is no showstopper,
4046 use a milestone like 2.1.x or 2.2.x.
4047 For all other bugs, do not set a milestone at all.
4050 \begin_layout Subsection
4051 Can we add rc entries in stable branch?
4054 \begin_layout Standard
4056 We are supposed to increase the prefs2prefs version number with such things.
4059 \begin_layout Section
4060 Documentation policies
4063 \begin_layout Standard
4064 The main documentation consists of these files:
4067 \begin_layout Description
4068 splash.lyx it is the first file you see after an installation.
4069 We assume that a new user sees this.
4070 It is therefore designed to be as simple as possible.
4071 Therefore please don't add any new formatting, only fix typos etc.
4072 Splash.lyx is up to date for \SpecialChar LyX
4073 2.1.x, currently maintained by Uwe Stöhr.
4076 \begin_layout Description
4077 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
4079 It therefore uses a limited set of formatting.
4080 For example a standard document class.
4081 Since new users will first learn about the formatting possibilities of
4083 please keep this file that simple.
4084 Intro.lyx is up to date for \SpecialChar LyX
4085 2.1.x, currently maintained by Uwe Stöhr.
4088 \begin_layout Description
4089 Tutorial.lyx our tutorial.
4090 It must be always up to date.
4091 Normally there is nothing to add since we don't want to overwhelm new users
4092 with too much details.
4093 The will learn these details while using \SpecialChar LyX
4094 and we have special manuals.
4095 Tutorial.lyx is up to date for \SpecialChar LyX
4096 2.1.x, currently maintained by Uwe Stöhr.
4099 \begin_layout Description
4100 UserGuide.lyx our main user guide.
4101 It covers a mixture of basic and detailed information.
4102 Some information is also in the Math and EmbeddedObjects manual so that
4103 the UserGuide refers to these files.
4104 UserGuide.lyx is up to date for \SpecialChar LyX
4105 2.1.x, currently maintained by Uwe Stöhr.
4108 \begin_layout Description
4109 EmbeddedObjects.lyx a special manual to explain things like tables floats
4112 EmbeddedObjects.lyx is up to date for \SpecialChar LyX
4113 2.1.x, currently maintained by Uwe
4117 \begin_layout Description
4118 Math.lyx a special manual to explain everything regarding math in all detail.
4119 Math.lyx is up to date for \SpecialChar LyX
4120 2.1.x, currently maintained by Uwe Stöhr.
4123 \begin_layout Description
4124 Additional.lyx this manual covers information that would be too much detail
4125 for the UserGuide or would make the UserGuide uncompilable or only compilable
4126 when installing a lot of special \SpecialChar LaTeX
4128 What should be in the UserGuide or better in Additional is a matter of
4130 it is up to you to decide that.
4131 Additional.lyx is not completely up to date for \SpecialChar LyX
4134 \begin_inset space ~
4137 8 is up to date and currently maintained by Uwe Stöhr.
4138 It certainly needs a rewrite and update.
4139 For example many info in chapter
4140 \begin_inset space ~
4143 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
4147 \begin_layout Description
4148 Customization.lyx this manual covers information how to customize \SpecialChar LyX
4150 output formats, operating systems, languages etc.
4151 It is currently completely out of date and needs a major rewrite and update.
4152 If you do this please assure that your information are given for all OSes
4153 and \SpecialChar LaTeX
4154 distributions (meaning be as objective as possible).
4157 \begin_layout Standard
4159 \begin_inset space ~
4162 rules in editing the docs:
4165 \begin_layout Enumerate
4166 If you are not the maintainer of a doc file or a chapter/section, you MUST
4167 use change tracking so that the maintainer could review your changes
4170 \begin_layout Enumerate
4171 Respect the formatting of the document.
4172 The different files use different formatting styles.
4173 That is OK and has historic reasons nobody fully know ;-).
4174 But it is important to be consistent within one file.
4177 \begin_layout Enumerate
4178 All changes you make to a file in one language MUST also go the file in
4179 the other actively maintained languages.
4180 Normally the maintainer does this for you, if you are the maintainer, you
4181 must do this by copying or changing the changed or added text to the other
4182 files so that the translators sees the blue underlined text and know what
4183 they have to translate and what was changed.
4186 \begin_layout Enumerate
4187 You MUST assure that the document is compilable as
4188 \begin_inset Quotes eld
4192 \begin_inset Quotes erd