1 #LyX 2.2 created this file. For more info see http://www.lyx.org/
5 \origin /systemlyxdir/doc/
7 \options BCOR8mm,captions=tableheading
8 \use_default_options false
12 \maintain_unincluded_children false
15 InsetLayout CharStyle:MenuItem
24 \newcommand*{\menuitem}[1]{{\sffamily #1}}
29 \language_package default
32 \font_roman "lmodern" "default"
33 \font_sans "lmss" "default"
34 \font_typewriter "lmtt" "default"
35 \font_math "auto" "auto"
36 \font_default_family default
37 \use_non_tex_fonts false
40 \font_sf_scale 100 100
41 \font_tt_scale 100 100
43 \default_output_format default
45 \bibtex_command default
46 \index_command default
50 \pdf_title "LyX's Development manual"
51 \pdf_author "LyX Team"
52 \pdf_subject "LyX's development documentation"
53 \pdf_keywords "LyX, Documentation, Development"
55 \pdf_bookmarksnumbered true
56 \pdf_bookmarksopen true
57 \pdf_bookmarksopenlevel 1
62 \pdf_pdfusetitle false
63 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
66 \use_package amsmath 1
67 \use_package amssymb 1
70 \use_package mathdots 1
71 \use_package mathtools 0
73 \use_package stackrel 0
74 \use_package stmaryrd 0
75 \use_package undertilde 0
77 \cite_engine_type default
81 \paperorientation portrait
85 \notefontcolor #0000ff
92 \paragraph_separation indent
93 \paragraph_indentation default
94 \quotes_language english
97 \paperpagestyle headings
98 \tracking_changes false
108 Developing \SpecialChar LyX
112 \begin_layout Subtitle
117 by the \SpecialChar LyX
122 \begin_layout Plain Layout
124 If you have comments or error corrections, please send them to the \SpecialChar LyX
127 \begin_inset Flex Code
130 \begin_layout Plain Layout
132 <lyx-docs@lists.lyx.org>
145 \begin_layout Standard
146 \begin_inset CommandInset toc
147 LatexCommand tableofcontents
154 \begin_layout Section
158 \begin_layout Standard
159 This manual documents some aspects of \SpecialChar LyX
161 It is currently rather incomplete, but will hopefully be extended in the
163 Meanwhile, additional information can be found in the
164 \begin_inset Flex Code
167 \begin_layout Plain Layout
173 subfolder of the \SpecialChar LyX
174 source code distribution.
175 This document is not translated, since the development language of \SpecialChar LyX
178 If you want to use \SpecialChar LyX
179 you don't need to read this manual.
180 However, if you want to learn more about how \SpecialChar LyX
181 is developed, or even want
182 to participate in \SpecialChar LyX
183 development, you may find some interesting information.
186 \begin_layout Section
190 \begin_layout Standard
192 uses several custom file formats for configuration files and documents.
193 This chapter contains some background concerning these file formats.
194 Several file formats are also described in detail in the regular user documenta
198 \begin_layout Subsection
202 \begin_layout Subsection
203 When is an update of the .lyx file format number needed?
204 \begin_inset CommandInset label
206 name "sec:When-is-an"
213 \begin_layout Standard
214 When you are working on a new feature you may ask yourself whether it needs
215 an update of the .lyx file format number.
216 Whether an update is needed or not is not always obvious.
217 Below you can find a list of reasons for file format updates with explanations:
220 \begin_layout Description
229 setting Whenever you introduce a new setting that is stored in the document
230 header, a file format update is needed.
231 This is also true if you add a new valid value to an existing setting,
233 \begin_inset space \thinspace{}
237 \begin_inset space \space{}
240 a new language that is stored in
241 \begin_inset Flex Code
244 \begin_layout Plain Layout
255 \begin_layout Description
264 setting If a certain setting becomes obsolete and gets removed, a file format
268 \begin_layout Description
273 inset Of course a new inset requires a file format update.
276 \begin_layout Description
281 style in any layout file or module shipped with \SpecialChar LyX
282 , or new shipped layout
284 These requirements are currently under discussion and might change in the
288 \begin_layout Description
301 package Any new math package that is automatically loaded needs a file format
303 The reason for this is that there is no true ERT inset for math formulas:
304 Each command is parsed, and if a user happens to defne a local command
305 with the same name as a command that triggers an automatic load of a package,
306 he needs to be able to switch off the automatic loading of that package.
307 This switch is stored by the
308 \begin_inset Flex Code
311 \begin_layout Plain Layout
320 \begin_layout Standard
321 If you are still unsure, please ask on the development list.
324 \begin_layout Subsection
325 How to update the file format number of .lyx files
328 \begin_layout Standard
329 Once you came to the conclusion that a file format update is needed you
330 should use the following procedure to perform the update:
333 \begin_layout Enumerate
334 Implement and test the new feature, including the reading and writing of
336 Note that any file produced at this stage does not use a valid format,
337 so do not use this version of \SpecialChar LyX
338 for working on any important documents.
341 \begin_layout Enumerate
342 Describe the new format in
343 \begin_inset Flex Code
346 \begin_layout Plain Layout
355 \begin_layout Enumerate
356 Update the \SpecialChar LyX
357 file format number in
358 \begin_inset Flex Code
361 \begin_layout Plain Layout
370 \begin_layout Enumerate
371 Update the range of file formats in the array
372 \begin_inset Flex Code
375 \begin_layout Plain Layout
382 \begin_inset Flex Code
385 \begin_layout Plain Layout
394 \begin_layout Enumerate
395 Add an entry to both format lists (for conversion and reversion) in
396 \begin_inset Newline newline
400 \begin_inset Flex Code
403 \begin_layout Plain Layout
404 lib/lyx2lyx/lyx_2_2.py
410 Add a conversion routine if needed (e.
411 \begin_inset space \thinspace{}
415 \begin_inset space \space{}
418 a new header setting always needs a conversion that adds the new setting,
419 a new document language does not need one).
420 Add a reversion routine if needed.
421 While the conversion routine is required to produce a document that is
422 equivalent to the old version, the requirements of the reversion are not
424 If possible, try to produce a proper reversion, using ERT if needed, but
425 for some features this might be too complicated.
426 In this case, the minimum requirement of the reversion routine is that
427 it produces a valid document which can be read by an older \SpecialChar LyX
429 If absolutely needed, even data loss is allowed for the reversion.
432 \begin_layout Enumerate
433 Since tex2lyx has several implicit file format dependencies caused by sharing
434 code with \SpecialChar LyX
435 , updating the file format of .lyx files produced by tex2lyx at
436 the same time as updating the main .lyx file format is strongly recommended.
437 Therefore, a compiler warning will be issued if the \SpecialChar LyX
438 and tex2lyx .lyx file
439 format numbers differ.
440 In many cases the tex2lyx update requires only the first and last item
442 \begin_inset Separator parbreak
449 \begin_layout Enumerate
450 Update the tex2lyx file format number in
451 \begin_inset Flex Code
454 \begin_layout Plain Layout
463 \begin_layout Enumerate
464 If the lyx2lyx conversion from the old to the new format is empty, or if
465 tex2lyx does not yet output the changed feature, you do not need any further
467 Otherwise, search for the changed feature in tex2lyx, and adjust the output
468 according to the lyx2lyx changes.
471 \begin_layout Enumerate
472 Update the tex2lyx test references as described in
473 \begin_inset CommandInset ref
474 LatexCommand formatted
475 reference "sec:Updating-test-references"
483 \begin_layout Enumerate
484 If you did not implement full tex2lyx support of the new feature, add a
486 \begin_inset Flex Code
489 \begin_layout Plain Layout
495 describing the missing bits.
496 Note that it is perfectly fine if you do not add full tex2lyx support for
497 a new feature: The updating recommendation above is only issued for the
498 syntax of the produced .lyx file.
499 It is no problem if some features supported by \SpecialChar LyX
500 are still output as ERT
501 by tex2lyx, since the problems in the past that resulted in the update
502 recommendation were related to mixed version syntax, not ERT.
505 \begin_layout Enumerate
506 It would be nice if you could create a .lyx test file which contains instances
507 of all changed or added features.
508 This could then be used to test lyx2lyx and tex2lyx.
509 Unfortunately it has not yet been decided how to collect such examples,
510 so please ask on the development list if you want to create one.
513 \begin_layout Subsection
514 Backporting new styles to the stable version
517 \begin_layout Standard
518 Starting with the stable \SpecialChar LyX
519 2.1 branch, there is a mechanism in place to backport
520 new styles to the stable version without the need to update the file format.
521 The basic idea is that the new style definition is automatically copied
522 to the document preamble, so that it can even be used by older minor revisions
523 that did not yet include the style.
524 To backport a new style to the stable version, the following steps are
528 \begin_layout Enumerate
530 \begin_inset Flex Code
533 \begin_layout Plain Layout
539 to the style definition in the development version.
542 \begin_layout Enumerate
543 Copy the style definition to the stable version, but use
544 \begin_inset Flex Code
547 \begin_layout Plain Layout
554 If needed adjust the format to the one used by the stable version (see
555 the customization manual for details of the layout file format).
558 \begin_layout Enumerate
559 For each update of the style in a later stable version, increase the argument
561 \begin_inset Flex Code
564 \begin_layout Plain Layout
570 by one (in the stable version, the development version should not be touched).
573 \begin_layout Standard
574 For details about the
575 \begin_inset Flex Code
578 \begin_layout Plain Layout
584 flag see the customization manual.
586 \begin_inset Flex Code
589 \begin_layout Plain Layout
595 support is needed for backported styles: Since the style of the development
596 version has an infinite version number, it will always be used.
597 Furthermore, since its version number is less than one, the style will
598 not be written anymore to the document header for files saved by the new
602 \begin_layout Standard
603 \begin_inset Newpage newpage
609 \begin_layout Section
613 \begin_layout Standard
614 Automated tests are an important tool to detect bugs and regressions in
615 software development.
616 Some projects like gcc even require each bug fix to be accompanied by a
617 test case for the automatic test suite, that would detect this bug.
618 Testing interactive features automatically is of course very hard, but
619 core functionality like document import and export can be tested quite
620 easily, and some tests of this kind exist.
623 \begin_layout Subsection
628 \begin_layout Standard
629 Some tests are located in the
630 \begin_inset Flex Code
633 \begin_layout Plain Layout
634 development/autotests
639 subfolder of the \SpecialChar LyX
640 source code distribution.
643 \begin_layout Subsubsection
647 \begin_layout Standard
648 cmake is required to run the \SpecialChar LyX
649 tests, running them is not implemented for
652 tests can be run by the commands
653 \begin_inset Flex Code
656 \begin_layout Plain Layout
663 \begin_inset Flex Code
666 \begin_layout Plain Layout
672 (when using a make based build system and not MSVC) in the
673 \begin_inset Flex Code
676 \begin_layout Plain Layout
682 subfolder of the build directory.
685 \begin_layout Subsection
689 \begin_layout Standard
690 The tex2lyx tests are located in the
691 \begin_inset Flex Code
694 \begin_layout Plain Layout
700 subfolder of the \SpecialChar LyX
701 source code distribution.
702 The actual testing is performed by the simple python script
703 \begin_inset Flex Code
706 \begin_layout Plain Layout
707 src/tex2lyx/test/runtests.py
713 Each test consists of two files:
714 \begin_inset Flex Code
717 \begin_layout Plain Layout
723 contains the \SpecialChar LaTeX
724 code that should be tested.
726 \begin_inset Flex Code
729 \begin_layout Plain Layout
735 contains the expected output of tex2lyx.
736 When a test is run, the actual produced output is compared with the stored
738 The test passes if both are identical.
739 The test machinery is also able to generate a file
740 \begin_inset Flex Code
743 \begin_layout Plain Layout
749 by exporting the produced .lyx file with \SpecialChar LyX
751 This may be useful for roundtrip comparisons.
754 \begin_layout Subsubsection
758 \begin_layout Standard
759 The tex2lyx tests can be run in several ways.
761 \begin_inset Flex Code
764 \begin_layout Plain Layout
770 subfolder of the build directory, the commands
771 \begin_inset Flex Code
774 \begin_layout Plain Layout
780 (cmake, all platforms),
781 \begin_inset Flex Code
784 \begin_layout Plain Layout
790 (cmake, when using a make based build system and not MSVC) or
791 \begin_inset Flex Code
794 \begin_layout Plain Layout
800 (autotools) will run the tex2lyx tests.
801 Alternatively, in the root of the build directory, the command
802 \begin_inset Flex Code
805 \begin_layout Plain Layout
811 runs all tests whose names match the regex
812 \begin_inset Quotes eld
816 \begin_inset Quotes erd
820 Another way to run the tex2lyx tests in the root build directory is to
821 instead use the command
822 \begin_inset Flex Code
825 \begin_layout Plain Layout
826 ctest -L '(cmplyx|roundtrip)'
831 , which runs all tests categorized with the label
832 \begin_inset Quotes eld
836 \begin_inset Quotes erd
840 \begin_inset Quotes eld
844 \begin_inset Quotes erd
848 If a test fails, the differences between the expected and actual results
849 are output in unified diff format.
852 \begin_layout Subsubsection
853 Updating test references
854 \begin_inset CommandInset label
856 name "sec:Updating-test-references"
863 \begin_layout Standard
864 In some cases a changed tex2lyx output is not a test failure, but wanted,
866 \begin_inset space \thinspace{}
870 \begin_inset space \space{}
873 if a tex2lyx bug was fixed, or a new feature was added.
874 In these cases the stored references need to be updated.
875 To do so if using autotools, call
876 \begin_inset Flex Code
879 \begin_layout Plain Layout
886 \begin_inset Flex Code
889 \begin_layout Plain Layout
895 subdirectory of the build directory.
896 If instead using CMake, call
897 \begin_inset Flex Code
900 \begin_layout Plain Layout
901 make updatetex2lyxtests
906 in the build directory or in the
907 \begin_inset Flex Code
910 \begin_layout Plain Layout
916 subdirectory of the build directory.
920 \begin_layout Plain Layout
921 Note that this is a case where a make target in the build directory can
922 affect the source directory, which might not be advisable.
927 On Windows do the following:
930 \begin_layout Itemize
931 Assure that the path to the python.exe is in your system PATH variable.
934 \begin_layout Itemize
935 Double-click on the file
936 \begin_inset Flex Code
939 \begin_layout Plain Layout
940 updatetex2lyxtests.vcxproj
945 in the build directory or in the
946 \begin_inset Flex Code
949 \begin_layout Plain Layout
955 subdirectory of your build directory.
958 \begin_layout Itemize
959 In the appearing MSVC program right-click on the project
963 in the project explorer and chose
970 \begin_layout Standard
971 For convenience, these commands also produce re-exported roundtrip .lyx.tex
973 Please examine the changed output carefully before committing the changed
974 files to the repository: Since the test machinery does not do a roundtrip
976 \begin_inset Formula $\Rightarrow$
980 \begin_inset Formula $\Rightarrow$
983 .tex, and does not compare the produced dvi or pdf output, it assumes that
984 the stored .lyx reference produces correct output if processed by \SpecialChar LyX
986 There is only one chance to detect wrong output: before committing a new
988 Once it is committed, it is quite difficult to verify whether it is correct.
991 \begin_layout Standard
996 update the test references by opening them with \SpecialChar LyX
997 or directly running lyx2lyx
999 This would not work, since lyx2lyx and \SpecialChar LyX
1000 produce slightly different files
1001 regarding insignificant whitespace and line breaks.
1004 \begin_layout Subsubsection
1008 \begin_layout Standard
1009 In many cases tests for new features may be added to one of the existing
1010 test files, but sometimes this is not possible or not wanted.
1011 Then a new test file needs to be added:
1014 \begin_layout Enumerate
1016 \begin_inset Flex Code
1019 \begin_layout Plain Layout
1020 src/tex2lyx/test/<test name>.tex
1025 and run tex2lyx in roundtrip mode to produce the file
1026 \begin_inset Flex Code
1029 \begin_layout Plain Layout
1030 src/tex2lyx/test/<test name>.lyx.lyx
1036 This file will be the new reference.
1039 \begin_layout Enumerate
1040 Once you confirmed that the tex2lyx output is correct, add the new files
1041 to the corresponding lists in
1042 \begin_inset Flex Code
1045 \begin_layout Plain Layout
1046 src/tex2lyx/test/runtests.py
1052 \begin_inset Flex Code
1055 \begin_layout Plain Layout
1056 src/tex2lyx/Makefile.am
1062 \begin_inset Flex Code
1065 \begin_layout Plain Layout
1066 src/tex2lyx/test/CMakeLists.txt
1074 \begin_layout Enumerate
1075 Commit the changes to the repository, or send a patch to the development
1076 list and ask for committing if you do not have commit rights.
1079 \begin_layout Subsection
1083 \begin_layout Standard
1084 The export tests are integration tests.
1085 They take longer to run and are more likely to break than the tex2lyx tests.
1086 Nevertheless, they have caught many regressions and without a better alternativ
1087 e it is important to keep them up-to-date and understand how they work.
1090 \begin_layout Subsubsection
1091 Expectations of LyX developers
1094 \begin_layout Standard
1095 Because the export tests are integration tests and take a long time to run,
1096 LyX developers are rarely expected to run all of the tests.
1097 Here are some good practices to follow by developers:
1100 \begin_layout Itemize
1101 When making a non-trivial change to a .layout file, run the export and layout
1102 tests corresponding with that .layout file.
1105 \begin_layout Itemize
1106 When making non-trivial changes to a .lyx file, run the export tests correspondin
1107 g to that .lyx file.
1110 \begin_layout Itemize
1111 When making non-trivial changes to LyX's LaTeX export code (e.g.
1112 touching the encoding code or package handling code that you expect will
1113 change the exported LaTeX in some way), consider running all of the export
1114 tests before and after your change.
1115 If there are differences, please reconcile these (i.e.
1116 fix the bug or fix the tests)
1121 Ask for help if you're not sure what to do or if you do not want to run
1122 the tests, post the patch on the list and others will run the tests.
1125 \begin_layout Itemize
1126 Understand how to interpret test failures.
1127 If your commit is found to have broken a test, you should be able to interpret
1128 the test results when made aware of them.
1130 \begin_inset CommandInset ref
1132 reference "subsec:Interpreting-export-tests"
1139 \begin_layout Subsubsection
1140 Configuring the tests
1143 \begin_layout Standard
1144 To enable these tests when using CMake, add the
1145 \begin_inset Flex Code
1148 \begin_layout Plain Layout
1149 -DLYX_ENABLE_EXPORT_TESTS=ON
1158 \begin_layout Standard
1159 \begin_inset Flex Code
1162 \begin_layout Plain Layout
1163 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
1171 \begin_layout Standard
1173 This flag will increase the time for the cmake command by several seconds,
1174 mainly because of the process of inverting tests (see Section
1175 \begin_inset CommandInset ref
1177 reference "subsec:Interpreting-export-tests"
1184 \begin_layout Subsubsection
1188 \begin_layout Standard
1189 To run all tests, in the build directory simply run the command
1190 \begin_inset Flex Code
1193 \begin_layout Plain Layout
1200 To run only some of the tests, use the command
1201 \begin_inset Flex Code
1204 \begin_layout Plain Layout
1211 \begin_inset Flex Code
1214 \begin_layout Plain Layout
1220 is a regular expression that matches test names.
1221 To run only the export tests, you can use
1222 \begin_inset Flex Code
1225 \begin_layout Plain Layout
1232 For the list of test categories available in addition to
1233 \begin_inset Quotes eld
1237 \begin_inset Quotes erd
1241 \begin_inset Flex Code
1244 \begin_layout Plain Layout
1245 ctest \SpecialChar nobreakdash
1246 \SpecialChar nobreakdash
1253 It is often useful to list the tests without running them (e.g.
1254 if you want to know how many tests there are or whether your
1255 \begin_inset Flex Code
1258 \begin_layout Plain Layout
1264 regular expression did what you expected).
1265 This can be done with the
1266 \begin_inset Flex Code
1269 \begin_layout Plain Layout
1276 \begin_inset Flex Code
1279 \begin_layout Plain Layout
1280 \SpecialChar nobreakdash
1281 \SpecialChar nobreakdash
1288 We are still working on getting the tests to run in parallel which is supported
1290 \begin_inset Flex Code
1293 \begin_layout Plain Layout
1300 \begin_inset Flex Code
1303 \begin_layout Plain Layout
1310 \begin_inset Flex Code
1313 \begin_layout Plain Layout
1314 \SpecialChar nobreakdash
1315 \SpecialChar nobreakdash
1322 However, when running the tests in parallel, sometimes tests fail that
1323 pass when run sequentially.
1324 A reasonable approach is to first run the tests in parallel and then run
1325 the failed tests sequentially.
1326 For example, to run 8 jobs at a time:
1329 \begin_layout Standard
1330 \begin_inset Flex Code
1333 \begin_layout Plain Layout
1342 \begin_layout Standard
1343 \begin_inset Flex Code
1346 \begin_layout Plain Layout
1347 ctest \SpecialChar nobreakdash
1348 \SpecialChar nobreakdash
1357 \begin_layout Standard
1359 Note that some tests cannot be run in parallel.
1360 These tests are marked in the code with the
1361 \begin_inset Flex Code
1364 \begin_layout Plain Layout
1374 \begin_layout Standard
1375 In some situations the option
1376 \begin_inset Flex Code
1379 \begin_layout Plain Layout
1380 \SpecialChar nobreakdash
1381 \SpecialChar nobreakdash
1388 There have been bugs in LyX and in LaTeX which cause compilation to hang,
1389 and without a timeout a test might never stop (in one case there was even
1391 If a test times out, the
1392 \begin_inset Flex Code
1395 \begin_layout Plain Layout
1401 command exits with error, but you can distinguish between a timed out test
1402 and a failed test in the output reported at the end of the
1403 \begin_inset Flex Code
1406 \begin_layout Plain Layout
1415 \begin_layout Subsubsection
1416 \begin_inset CommandInset label
1418 name "subsec:Interpreting-export-tests"
1422 Interpreting the export test results
1425 \begin_layout Standard
1426 A test can fail for several reasons, not all of them bad.
1429 \begin_layout Enumerate
1430 The .lyx file could have been added recently and some formats are not expected
1434 \begin_layout Enumerate
1435 A dependency is not met (e.g.
1436 the LaTeX class file).
1437 One hint that this is the case is that the corresponding
1438 \begin_inset Flex Code
1441 \begin_layout Plain Layout
1447 test will likely also fail.
1450 \begin_layout Enumerate
1451 An export that previously failed to compile now compiles.
1454 \begin_layout Enumerate
1455 An external dependency was updated (e.g.
1459 \begin_layout Enumerate
1460 A recent code change introduced a bug.
1463 \begin_layout Enumerate
1464 \begin_inset CommandInset label
1470 A change in a document exposed the incompatibility of that class with an
1475 \begin_layout Standard
1476 Because the .lyx files are exported in several formats, it is not surprising
1477 that many of the exports fail.
1478 This expectation of failure is addressed by
1479 \begin_inset Quotes eld
1483 \begin_inset Quotes erd
1486 the tests, that is, by marking the test as
1487 \begin_inset Quotes eld
1491 \begin_inset Quotes erd
1494 if the export exits with error and as
1495 \begin_inset Quotes eld
1499 \begin_inset Quotes erd
1502 if the export succeeds
1507 It follows that these expected failures will not show up as failed tests
1508 in the test results and thus will not pollute the
1509 \begin_inset Quotes eld
1513 \begin_inset Quotes erd
1517 If the export actually succeeds, then the test will fail.
1518 The purpose of this failure is to get your attention—something has changed,
1519 possibly for the better.
1522 \begin_layout Standard
1523 We try to document why a test is inverted or ignored.
1524 See the comment (prefixed with
1525 \begin_inset Flex Code
1528 \begin_layout Plain Layout
1534 ) above the block in which the test is listed as inverted or ignored in
1536 \begin_inset Flex Code
1539 \begin_layout Plain Layout
1540 development/autotests/revertedTests
1546 \begin_inset Flex Code
1549 \begin_layout Plain Layout
1550 development/autotests/ignoredTests
1556 It is possible that an export goes from succeeding to failing just because
1557 the document was changed and the document was never expected to work with
1558 a certain export format in the first case.
1559 Once this is confirmed to be the situation, the test can be inverted.
1562 \begin_layout Standard
1563 A good question is why do we enable the tests for non-default formats? The
1564 answer is that if a non-default route is broken it is often because a bug
1565 was introduced in LyX and not because a document-specific change was made
1566 that is not supported by the route.
1567 In other words, there is a high signal/noise ratio in the export tests
1568 for the non-default formats.
1572 \begin_layout Standard
1573 What action should you take if a test fails? First, check manually that
1574 when the compilation succeeded before the resulting PDF was good.
1575 In fact, sometimes it is an improvement when a test fails.
1576 If you check manually, it might be the case that the export was succeeding
1577 before but showing garbled text in a PDF output.
1578 Now it might fail with a clear message of "language xyz not supported".
1579 It is always good to check manually why something fails and if it passes
1580 if the PDF output is good.
1583 \begin_layout Standard
1584 Sometimes a test is fixed by accident.
1585 We should uninvert a test (remove it from the
1586 \begin_inset Flex Code
1589 \begin_layout Plain Layout
1595 file) in order to preserve the fix.
1598 \begin_layout Standard
1599 When a test or several tests fail, consider checking the files in the
1600 \begin_inset Flex Code
1603 \begin_layout Plain Layout
1609 subdirectory of your build directory.
1610 In this subdirectory are three files: the file
1611 \begin_inset Flex Code
1614 \begin_layout Plain Layout
1620 simply lists the tests that failed on your last
1621 \begin_inset Flex Code
1624 \begin_layout Plain Layout
1631 \begin_inset Flex Code
1634 \begin_layout Plain Layout
1640 file contains the output from the tests (and often has details explaining
1641 why a test failed); and the
1642 \begin_inset Flex Code
1645 \begin_layout Plain Layout
1651 file lists the times that it took to run the tests.
1654 \begin_layout Subsubsection
1658 \begin_layout Standard
1659 Some inverted tests are 'suspended'.
1660 This means, they are not executed using
1661 \begin_inset Flex Code
1664 \begin_layout Plain Layout
1671 \begin_inset Flex Code
1674 \begin_layout Plain Layout
1681 From time to time they still have to be checked.
1684 \begin_layout Standard
1685 These tests are suspended, because they fail for known reasons which cannot
1687 But it is expected the reason might disappear in the future.
1688 Be it new TL or better handling in \SpecialChar LyX
1692 \begin_layout Standard
1693 For ctest commands without the
1694 \begin_inset Flex Code
1697 \begin_layout Plain Layout
1703 parameter nothing changes.
1704 Suspended or not, tests will be executed depending only on the regexes
1705 parameters given to the ctest command.
1708 \begin_layout Subsection
1712 \begin_layout Standard
1713 These tests check whether a .lyx file loads without any terminal messages.
1714 They correspond to the manual operations of simply opening a .lyx file on
1715 the terminal, exiting LyX once the file is loaded, and then checking whether
1716 there is any output from the terminal.
1717 These tests are useful for catching malformed .lyx files and parsing bugs.
1718 They can also be used to find a .lyx file in which an instance of something
1720 To do this, compile LyX with a local patch that outputs something to the
1721 terminal when an instance is found, and then run the check_load tests to
1722 see if any fail, which would mean that the situation occurs in the LyX
1723 documentation files corresponding to the failed tests.
1724 These tests are expectedly fragile: any LyX diagnostic message, which is
1725 not necessarily an error, would cause the tests to fail.
1726 Similarly, any message output by a library (e.g.
1727 Qt) would also cause failure.
1728 There are some messages that the check_load tests are instructed to ignore,
1729 which are stored in the file
1730 \begin_inset Flex Code
1733 \begin_layout Plain Layout
1734 development/autotests/filterCheckWarnings
1742 \begin_layout Subsection
1746 \begin_layout Standard
1747 The URL tests are enabled with the
1748 \begin_inset Flex Code
1751 \begin_layout Plain Layout
1752 -DLYX_ENABLE_URLTESTS=ON
1757 CMake flag and are useful for finding broken links in our documentation
1759 If a URL test fails, to see which link in particular was reported as broken,
1761 \begin_inset Flex Code
1764 \begin_layout Plain Layout
1771 These tests are extremely fragile (e.g.
1772 a test can depend on your Internet connection) and a failed URL test should
1773 not be taken too seriously.
1776 \begin_layout Section
1777 Development policies
1780 \begin_layout Standard
1781 This chapter lists some guidelines that should be followed.
1782 This list is not complete, and many guidelines are in separate chapters,
1784 \begin_inset Quotes eld
1787 When is an update of the .lyx file format number needed?
1788 \begin_inset Quotes erd
1792 \begin_inset CommandInset ref
1794 reference "sec:When-is-an"
1801 \begin_layout Subsection
1802 When to set a fixed milestone?
1805 \begin_layout Standard
1806 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
1810 \begin_layout Enumerate
1811 Somebody is actively working on a fix.
1814 \begin_layout Enumerate
1815 The bug is so severe that it would block the release if it is not fixed.
1818 \begin_layout Standard
1819 If a bug is important, but nobody is working on it, and it is no showstopper,
1820 use a milestone like 2.1.x or 2.2.x.
1821 For all other bugs, do not set a milestone at all.
1824 \begin_layout Subsection
1825 Can we add rc entries in stable branch?
1828 \begin_layout Standard
1830 We are supposed to increase the prefs2prefs version number with such things.
1833 \begin_layout Section
1834 Documentation policies
1837 \begin_layout Standard
1838 The main documentation consists of these files:
1841 \begin_layout Description
1842 splash.lyx it is the first file you see after an installation.
1843 We assume that a new user sees this.
1844 It is therefore designed to be as simple as possible.
1845 Therefore please don't add any new formatting, only fix typos etc.
1846 Splash.lyx is up to date for \SpecialChar LyX
1847 2.1.x, currently maintained by Uwe Stöhr.
1850 \begin_layout Description
1851 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
1853 It therefore uses a limited set of formatting.
1854 For example a standard document class.
1855 Since new users will first learn about the formatting possibilities of
1857 please keep this file that simple.
1858 Intro.lyx is up to date for \SpecialChar LyX
1859 2.1.x, currently maintained by Uwe Stöhr.
1862 \begin_layout Description
1863 Tutorial.lyx our tutorial.
1864 It must be always up to date.
1865 Normally there is nothing to add since we don't want to overwhelm new users
1866 with too much details.
1867 The will learn these details while using \SpecialChar LyX
1868 and we have special manuals.
1869 Tutorial.lyx is up to date for \SpecialChar LyX
1870 2.1.x, currently maintained by Uwe Stöhr.
1873 \begin_layout Description
1874 UserGuide.lyx our main user guide.
1875 It covers a mixture of basic and detailed information.
1876 Some information is also in the Math and EmbeddedObjects manual so that
1877 the UserGuide refers to these files.
1878 UserGuide.lyx is up to date for \SpecialChar LyX
1879 2.1.x, currently maintained by Uwe Stöhr.
1882 \begin_layout Description
1883 EmbeddedObjects.lyx a special manual to explain things like tables floats
1886 EmbeddedObjects.lyx is up to date for \SpecialChar LyX
1887 2.1.x, currently maintained by Uwe
1891 \begin_layout Description
1892 Math.lyx a special manual to explain everything regarding math in all detail.
1893 Math.lyx is up to date for \SpecialChar LyX
1894 2.1.x, currently maintained by Uwe Stöhr.
1897 \begin_layout Description
1898 Additional.lyx this manual covers information that would be too much detail
1899 for the UserGuide or would make the UserGuide uncompilable or only compilable
1900 when installing a lot of special \SpecialChar LaTeX
1902 What should be in the UserGuide or better in Additional is a matter of
1904 it is up to you to decide that.
1905 Additional.lyx is not completely up to date for \SpecialChar LyX
1908 \begin_inset space ~
1911 8 is up to date and currently maintained by Uwe Stöhr.
1912 It certainly needs a rewrite and update.
1913 For example many info in chapter
1914 \begin_inset space ~
1917 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
1921 \begin_layout Description
1922 Customization.lyx this manual covers information how to customize \SpecialChar LyX
1924 output formats, operating systems, languages etc.
1925 It is currently completely out of date and needs a major rewrite and update.
1926 If you do this please assure that your information are given for all OSes
1927 and \SpecialChar LaTeX
1928 distributions (meaning be as objective as possible).
1931 \begin_layout Standard
1933 \begin_inset space ~
1936 rules in editing the docs:
1939 \begin_layout Enumerate
1940 If you are not the maintainer of a doc file or a chapter/section, you MUST
1941 use change tracking so that the maintainer could review your changes
1944 \begin_layout Enumerate
1945 Respect the formatting of the document.
1946 The different files use different formatting styles.
1947 That is OK and has historic reasons nobody fully know ;-).
1948 But it is important to be consistent within one file.
1951 \begin_layout Enumerate
1952 All changes you make to a file in one language MUST also go the file in
1953 the other actively maintained languages.
1954 Normally the maintainer does this for you, if you are the maintainer, you
1955 must do this by copying or changing the changed or added text to the other
1956 files so that the translators sees the blue underlined text and know what
1957 they have to translate and what was changed.
1960 \begin_layout Enumerate
1961 You MUST assure that the document is compilable as
1962 \begin_inset Quotes eld
1966 \begin_inset Quotes erd