]> git.lyx.org Git - lyx.git/blob - lib/doc/Development.lyx
Describe some ctest extras.
[lyx.git] / lib / doc / Development.lyx
1 #LyX 2.2 created this file. For more info see http://www.lyx.org/
2 \lyxformat 502
3 \begin_document
4 \begin_header
5 \origin unavailable
6 \textclass scrartcl
7 \options BCOR8mm,captions=tableheading
8 \use_default_options false
9 \begin_modules
10 logicalmkup
11 \end_modules
12 \maintain_unincluded_children false
13 \begin_local_layout
14 Format 7
15 InsetLayout CharStyle:MenuItem
16 LyxType               charstyle
17 LabelString           menu
18 LatexType             command
19 LatexName             menuitem
20 Font
21 Family              Sans
22 EndFont
23 Preamble
24 \newcommand*{\menuitem}[1]{{\sffamily #1}}
25 EndPreamble
26 End
27 \end_local_layout
28 \language english
29 \language_package default
30 \inputencoding auto
31 \fontencoding global
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
38 \font_sc false
39 \font_osf false
40 \font_sf_scale 100 100
41 \font_tt_scale 100 100
42 \graphics default
43 \default_output_format default
44 \output_sync 0
45 \bibtex_command default
46 \index_command default
47 \paperfontsize 12
48 \spacing single
49 \use_hyperref true
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"
54 \pdf_bookmarks true
55 \pdf_bookmarksnumbered true
56 \pdf_bookmarksopen true
57 \pdf_bookmarksopenlevel 1
58 \pdf_breaklinks false
59 \pdf_pdfborder false
60 \pdf_colorlinks true
61 \pdf_backref false
62 \pdf_pdfusetitle false
63 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
64 \papersize a4paper
65 \use_geometry false
66 \use_package amsmath 1
67 \use_package amssymb 1
68 \use_package cancel 0
69 \use_package esint 0
70 \use_package mathdots 1
71 \use_package mathtools 0
72 \use_package mhchem 1
73 \use_package stackrel 0
74 \use_package stmaryrd 0
75 \use_package undertilde 0
76 \cite_engine basic
77 \cite_engine_type default
78 \biblio_style plain
79 \use_bibtopic false
80 \use_indices false
81 \paperorientation portrait
82 \suppress_date false
83 \justification true
84 \use_refstyle 0
85 \notefontcolor #0000ff
86 \index Index
87 \shortcut idx
88 \color #008000
89 \end_index
90 \secnumdepth 4
91 \tocdepth 4
92 \paragraph_separation indent
93 \paragraph_indentation default
94 \quotes_language english
95 \papercolumns 1
96 \papersides 2
97 \paperpagestyle headings
98 \tracking_changes false
99 \output_changes false
100 \html_math_output 0
101 \html_css_as_file 0
102 \html_be_strict true
103 \end_header
104
105 \begin_body
106
107 \begin_layout Title
108 Developing \SpecialChar LyX
109
110 \end_layout
111
112 \begin_layout Subtitle
113 Version 2.2.x
114 \end_layout
115
116 \begin_layout Author
117 by the \SpecialChar LyX
118  Team
119 \begin_inset Foot
120 status collapsed
121
122 \begin_layout Plain Layout
123 \noindent
124 If you have comments or error corrections, please send them to the \SpecialChar LyX
125  Documentatio
126 n mailing list, 
127 \begin_inset Flex Code
128 status collapsed
129
130 \begin_layout Plain Layout
131 \noindent
132 <lyx-docs@lists.lyx.org>
133 \end_layout
134
135 \end_inset
136
137 .
138 \end_layout
139
140 \end_inset
141
142
143 \end_layout
144
145 \begin_layout Standard
146 \begin_inset CommandInset toc
147 LatexCommand tableofcontents
148
149 \end_inset
150
151
152 \end_layout
153
154 \begin_layout Section
155 Introduction
156 \end_layout
157
158 \begin_layout Standard
159 This manual documents some aspects of \SpecialChar LyX
160  development.
161  It is currently rather incomplete, but will hopefully be extended in the
162  future.
163  Meanwhile, additional information can be found in the 
164 \begin_inset Flex Code
165 status collapsed
166
167 \begin_layout Plain Layout
168 development
169 \end_layout
170
171 \end_inset
172
173  subfolder of the \SpecialChar LyX
174  source code distribution.
175  This document is not translated, since the development language of \SpecialChar LyX
176  is
177  english.
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.
184 \end_layout
185
186 \begin_layout Section
187 File formats
188 \end_layout
189
190 \begin_layout Standard
191 \SpecialChar LyX
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
195 tion.
196 \end_layout
197
198 \begin_layout Subsection
199 File Format Numbers
200 \end_layout
201
202 \begin_layout Subsection
203 When is an update of the .lyx file format number needed?
204 \begin_inset CommandInset label
205 LatexCommand label
206 name "sec:When-is-an"
207
208 \end_inset
209
210
211 \end_layout
212
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:
218 \end_layout
219
220 \begin_layout Description
221 New
222 \begin_inset space ~
223 \end_inset
224
225 document
226 \begin_inset space ~
227 \end_inset
228
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,
232  e.
233 \begin_inset space \thinspace{}
234 \end_inset
235
236 g.
237 \begin_inset space \space{}
238 \end_inset
239
240 a new language that is stored in 
241 \begin_inset Flex Code
242 status collapsed
243
244 \begin_layout Plain Layout
245
246 \backslash
247 language
248 \end_layout
249
250 \end_inset
251
252 .
253 \end_layout
254
255 \begin_layout Description
256 Removed
257 \begin_inset space ~
258 \end_inset
259
260 document
261 \begin_inset space ~
262 \end_inset
263
264 setting If a certain setting becomes obsolete and gets removed, a file format
265  update is needed.
266 \end_layout
267
268 \begin_layout Description
269 New
270 \begin_inset space ~
271 \end_inset
272
273 inset Of course a new inset requires a file format update.
274 \end_layout
275
276 \begin_layout Description
277 New
278 \begin_inset space ~
279 \end_inset
280
281 style in any layout file or module shipped with \SpecialChar LyX
282 , or new shipped layout
283  file or module.
284  These requirements are currently under discussion and might change in the
285  future.
286 \end_layout
287
288 \begin_layout Description
289 Automatically
290 \begin_inset space ~
291 \end_inset
292
293 loaded
294 \begin_inset space ~
295 \end_inset
296
297 math
298 \begin_inset space ~
299 \end_inset
300
301 package Any new math package that is automatically loaded needs a file format
302  update.
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
309 status collapsed
310
311 \begin_layout Plain Layout
312 use_package
313 \end_layout
314
315 \end_inset
316
317  header setting.
318 \end_layout
319
320 \begin_layout Standard
321 If you are still unsure, please ask on the development list.
322 \end_layout
323
324 \begin_layout Subsection
325 How to update the file format number of .lyx files
326 \end_layout
327
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:
331 \end_layout
332
333 \begin_layout Enumerate
334 Implement and test the new feature, including the reading and writing of
335  .lyx files.
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.
339 \end_layout
340
341 \begin_layout Enumerate
342 Describe the new format in 
343 \begin_inset Flex Code
344 status collapsed
345
346 \begin_layout Plain Layout
347 development/FORMAT
348 \end_layout
349
350 \end_inset
351
352 .
353 \end_layout
354
355 \begin_layout Enumerate
356 Update the \SpecialChar LyX
357  file format number in 
358 \begin_inset Flex Code
359 status collapsed
360
361 \begin_layout Plain Layout
362 src/version.h
363 \end_layout
364
365 \end_inset
366
367 .
368 \end_layout
369
370 \begin_layout Enumerate
371 Update the range of file formats in the array 
372 \begin_inset Flex Code
373 status collapsed
374
375 \begin_layout Plain Layout
376 format_relation
377 \end_layout
378
379 \end_inset
380
381  in 
382 \begin_inset Flex Code
383 status collapsed
384
385 \begin_layout Plain Layout
386 lib/lyx2lyx/LyX.py
387 \end_layout
388
389 \end_inset
390
391 .
392 \end_layout
393
394 \begin_layout Enumerate
395 Add an entry to both format lists (for conversion and reversion) in
396 \begin_inset Newline newline
397 \end_inset
398
399
400 \begin_inset Flex Code
401 status collapsed
402
403 \begin_layout Plain Layout
404 lib/lyx2lyx/lyx_2_2.py
405 \end_layout
406
407 \end_inset
408
409 .
410  Add a conversion routine if needed (e.
411 \begin_inset space \thinspace{}
412 \end_inset
413
414 g.
415 \begin_inset space \space{}
416 \end_inset
417
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
423  that strict.
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
428 .
429  If absolutely needed, even data loss is allowed for the reversion.
430 \end_layout
431
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
441  of the list below:
442 \begin_inset Separator parbreak
443 \end_inset
444
445
446 \end_layout
447
448 \begin_deeper
449 \begin_layout Enumerate
450 Update the tex2lyx file format number in 
451 \begin_inset Flex Code
452 status collapsed
453
454 \begin_layout Plain Layout
455 src/version.h
456 \end_layout
457
458 \end_inset
459
460 .
461 \end_layout
462
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
466  tex2lyx changes.
467  Otherwise, search for the changed feature in tex2lyx, and adjust the output
468  according to the lyx2lyx changes.
469 \end_layout
470
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"
476
477 \end_inset
478
479 .
480 \end_layout
481
482 \end_deeper
483 \begin_layout Enumerate
484 If you did not implement full tex2lyx support of the new feature, add a
485  line to 
486 \begin_inset Flex Code
487 status collapsed
488
489 \begin_layout Plain Layout
490 src/tex2lyx/TODO.txt
491 \end_layout
492
493 \end_inset
494
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.
503 \end_layout
504
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.
511 \end_layout
512
513 \begin_layout Subsection
514 Backporting new styles to the stable version
515 \end_layout
516
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
525  needed:
526 \end_layout
527
528 \begin_layout Enumerate
529 Add the line 
530 \begin_inset Flex Code
531 status collapsed
532
533 \begin_layout Plain Layout
534 ForceLocal -1
535 \end_layout
536
537 \end_inset
538
539  to the style definition in the development version.
540 \end_layout
541
542 \begin_layout Enumerate
543 Copy the style definition to the stable version, but use 
544 \begin_inset Flex Code
545 status collapsed
546
547 \begin_layout Plain Layout
548 ForceLocal 1
549 \end_layout
550
551 \end_inset
552
553  instead.
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).
556 \end_layout
557
558 \begin_layout Enumerate
559 For each update of the style in a later stable version, increase the argument
560  of 
561 \begin_inset Flex Code
562 status collapsed
563
564 \begin_layout Plain Layout
565 ForceLocal
566 \end_layout
567
568 \end_inset
569
570  by one (in the stable version, the development version should not be touched).
571 \end_layout
572
573 \begin_layout Standard
574 For details about the 
575 \begin_inset Flex Code
576 status collapsed
577
578 \begin_layout Plain Layout
579 ForceLocal
580 \end_layout
581
582 \end_inset
583
584  flag see the customization manual.
585  No 
586 \begin_inset Flex Code
587 status collapsed
588
589 \begin_layout Plain Layout
590 lyx2lyx
591 \end_layout
592
593 \end_inset
594
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
599  version.
600 \end_layout
601
602 \begin_layout Standard
603 \begin_inset Newpage newpage
604 \end_inset
605
606
607 \end_layout
608
609 \begin_layout Section
610 Tests
611 \end_layout
612
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.
621 \end_layout
622
623 \begin_layout Subsection
624 \SpecialChar LyX
625  tests
626 \end_layout
627
628 \begin_layout Standard
629 Some tests are located in the 
630 \begin_inset Flex Code
631 status collapsed
632
633 \begin_layout Plain Layout
634 development/autotests
635 \end_layout
636
637 \end_inset
638
639  subfolder of the \SpecialChar LyX
640  source code distribution.
641 \end_layout
642
643 \begin_layout Subsubsection
644 Running the tests
645 \end_layout
646
647 \begin_layout Standard
648 cmake is required to run the \SpecialChar LyX
649  tests, running them is not implemented for
650  autotools.
651  The \SpecialChar LyX
652  tests can be run by the commands 
653 \begin_inset Flex Code
654 status collapsed
655
656 \begin_layout Plain Layout
657 ctest
658 \end_layout
659
660 \end_inset
661
662  (all platforms) or 
663 \begin_inset Flex Code
664 status collapsed
665
666 \begin_layout Plain Layout
667 make test
668 \end_layout
669
670 \end_inset
671
672  (when using a make based build system and not MSVC) in the 
673 \begin_inset Flex Code
674 status collapsed
675
676 \begin_layout Plain Layout
677 autotests
678 \end_layout
679
680 \end_inset
681
682  subfolder of the build directory.
683 \end_layout
684
685 \begin_layout Subsection
686 tex2lyx tests
687 \end_layout
688
689 \begin_layout Standard
690 The tex2lyx tests are located in the 
691 \begin_inset Flex Code
692 status collapsed
693
694 \begin_layout Plain Layout
695 src/tex2lyx/test
696 \end_layout
697
698 \end_inset
699
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
704 status collapsed
705
706 \begin_layout Plain Layout
707 src/tex2lyx/test/runtests.py
708 \end_layout
709
710 \end_inset
711
712 .
713  Each test consists of two files: 
714 \begin_inset Flex Code
715 status collapsed
716
717 \begin_layout Plain Layout
718 <test name>.tex
719 \end_layout
720
721 \end_inset
722
723  contains the \SpecialChar LaTeX
724  code that should be tested.
725  
726 \begin_inset Flex Code
727 status collapsed
728
729 \begin_layout Plain Layout
730 <test name>.lyx.lyx
731 \end_layout
732
733 \end_inset
734
735  contains the expected output of tex2lyx.
736  When a test is run, the actual produced output is compared with the stored
737  reference output.
738  The test passes if both are identical.
739  The test machinery is also able to generate a file 
740 \begin_inset Flex Code
741 status collapsed
742
743 \begin_layout Plain Layout
744 <test name>.lyx.tex
745 \end_layout
746
747 \end_inset
748
749  by exporting the produced .lyx file with \SpecialChar LyX
750  again.
751  This may be useful for roundtrip comparisons.
752 \end_layout
753
754 \begin_layout Subsubsection
755 Running the tests
756 \end_layout
757
758 \begin_layout Standard
759 The tex2lyx tests can be run in several ways.
760  When in the 
761 \begin_inset Flex Code
762 status collapsed
763
764 \begin_layout Plain Layout
765 src/tex2lyx
766 \end_layout
767
768 \end_inset
769
770  subfolder of the build directory, the commands 
771 \begin_inset Flex Code
772 status collapsed
773
774 \begin_layout Plain Layout
775 ctest
776 \end_layout
777
778 \end_inset
779
780  (cmake, all platforms), 
781 \begin_inset Flex Code
782 status collapsed
783
784 \begin_layout Plain Layout
785 make test
786 \end_layout
787
788 \end_inset
789
790  (cmake, when using a make based build system and not MSVC) or 
791 \begin_inset Flex Code
792 status collapsed
793
794 \begin_layout Plain Layout
795 make alltests
796 \end_layout
797
798 \end_inset
799
800  (autotools) will run the tex2lyx tests.
801  Alternatively, in the root of the build directory, the command 
802 \begin_inset Flex Code
803 status collapsed
804
805 \begin_layout Plain Layout
806 ctest -R tex2lyx
807 \end_layout
808
809 \end_inset
810
811  runs all tests whose names match the regex 
812 \begin_inset Quotes eld
813 \end_inset
814
815 tex2lyx
816 \begin_inset Quotes erd
817 \end_inset
818
819 .
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
823 status collapsed
824
825 \begin_layout Plain Layout
826 ctest -L '(cmplyx|roundtrip)'
827 \end_layout
828
829 \end_inset
830
831 , which runs all tests categorized with the label 
832 \begin_inset Quotes eld
833 \end_inset
834
835 roundtrip
836 \begin_inset Quotes erd
837 \end_inset
838
839  or 
840 \begin_inset Quotes eld
841 \end_inset
842
843 cmplyx
844 \begin_inset Quotes erd
845 \end_inset
846
847 .
848  If a test fails, the differences between the expected and actual results
849  are output in unified diff format.
850 \end_layout
851
852 \begin_layout Subsubsection
853 Updating test references
854 \begin_inset CommandInset label
855 LatexCommand label
856 name "sec:Updating-test-references"
857
858 \end_inset
859
860
861 \end_layout
862
863 \begin_layout Standard
864 In some cases a changed tex2lyx output is not a test failure, but wanted,
865  e.
866 \begin_inset space \thinspace{}
867 \end_inset
868
869 g.
870 \begin_inset space \space{}
871 \end_inset
872
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
877 status collapsed
878
879 \begin_layout Plain Layout
880 make updatetests
881 \end_layout
882
883 \end_inset
884
885  in the 
886 \begin_inset Flex Code
887 status collapsed
888
889 \begin_layout Plain Layout
890 src/tex2lyx
891 \end_layout
892
893 \end_inset
894
895  subdirectory of the build directory.
896  If instead using CMake, call 
897 \begin_inset Flex Code
898 status collapsed
899
900 \begin_layout Plain Layout
901 make updatetex2lyxtests
902 \end_layout
903
904 \end_inset
905
906  in the build directory or in the 
907 \begin_inset Flex Code
908 status collapsed
909
910 \begin_layout Plain Layout
911 src/tex2lyx/test
912 \end_layout
913
914 \end_inset
915
916  subdirectory of the build directory.
917 \begin_inset Foot
918 status collapsed
919
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.
923 \end_layout
924
925 \end_inset
926
927  On Windows do the following:
928 \end_layout
929
930 \begin_layout Itemize
931 Assure that the path to the python.exe is in your system PATH variable.
932 \end_layout
933
934 \begin_layout Itemize
935 Double-click on the file 
936 \begin_inset Flex Code
937 status collapsed
938
939 \begin_layout Plain Layout
940 updatetex2lyxtests.vcxproj
941 \end_layout
942
943 \end_inset
944
945  in the build directory or in the 
946 \begin_inset Flex Code
947 status collapsed
948
949 \begin_layout Plain Layout
950 src/tex2lyx/test
951 \end_layout
952
953 \end_inset
954
955  subdirectory of your build directory.
956 \end_layout
957
958 \begin_layout Itemize
959 In the appearing MSVC program right-click on the project 
960 \family sans
961 updatetex2lyxtests
962 \family default
963  in the project explorer and chose 
964 \family sans
965 Create
966 \family default
967 .
968 \end_layout
969
970 \begin_layout Standard
971 For convenience, these commands also produce re-exported roundtrip .lyx.tex
972  files.
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
975  test .tex 
976 \begin_inset Formula $\Rightarrow$
977 \end_inset
978
979  .lyx 
980 \begin_inset Formula $\Rightarrow$
981 \end_inset
982
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
985 .
986  There is only one chance to detect wrong output: before committing a new
987  reference.
988  Once it is committed, it is quite difficult to verify whether it is correct.
989 \end_layout
990
991 \begin_layout Standard
992 Please 
993 \emph on
994 do not
995 \emph default
996  update the test references by opening them with \SpecialChar LyX
997  or directly running lyx2lyx
998  on them.
999  This would not work, since lyx2lyx and \SpecialChar LyX
1000  produce slightly different files
1001  regarding insignificant whitespace and line breaks.
1002 \end_layout
1003
1004 \begin_layout Subsubsection
1005 Adding a new test
1006 \end_layout
1007
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:
1012 \end_layout
1013
1014 \begin_layout Enumerate
1015 Create the new file 
1016 \begin_inset Flex Code
1017 status collapsed
1018
1019 \begin_layout Plain Layout
1020 src/tex2lyx/test/<test name>.tex
1021 \end_layout
1022
1023 \end_inset
1024
1025  and run tex2lyx in roundtrip mode to produce the file 
1026 \begin_inset Flex Code
1027 status collapsed
1028
1029 \begin_layout Plain Layout
1030 src/tex2lyx/test/<test name>.lyx.lyx
1031 \end_layout
1032
1033 \end_inset
1034
1035 .
1036  This file will be the new reference.
1037 \end_layout
1038
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
1043 status collapsed
1044
1045 \begin_layout Plain Layout
1046 src/tex2lyx/test/runtests.py
1047 \end_layout
1048
1049 \end_inset
1050
1051
1052 \begin_inset Flex Code
1053 status collapsed
1054
1055 \begin_layout Plain Layout
1056 src/tex2lyx/Makefile.am
1057 \end_layout
1058
1059 \end_inset
1060
1061  and 
1062 \begin_inset Flex Code
1063 status collapsed
1064
1065 \begin_layout Plain Layout
1066 src/tex2lyx/test/CMakeLists.txt
1067 \end_layout
1068
1069 \end_inset
1070
1071 .
1072 \end_layout
1073
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.
1077 \end_layout
1078
1079 \begin_layout Subsection
1080 Export tests (cmake only)
1081 \end_layout
1082
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.
1088 \end_layout
1089
1090 \begin_layout Subsubsection
1091 Expectations of LyX developers
1092 \end_layout
1093
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:
1098 \end_layout
1099
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.
1103 \end_layout
1104
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.
1108 \end_layout
1109
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) 
1117 \emph on
1118 before
1119 \emph default
1120  committing.
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.
1123 \end_layout
1124
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.
1129  See Section 
1130 \begin_inset CommandInset ref
1131 LatexCommand ref
1132 reference "subsec:Interpreting-export-tests"
1133
1134 \end_inset
1135
1136 .
1137 \end_layout
1138
1139 \begin_layout Subsubsection
1140 Configuring the tests
1141 \end_layout
1142
1143 \begin_layout Standard
1144 To enable these tests, add the 
1145 \begin_inset Flex Code
1146 status collapsed
1147
1148 \begin_layout Plain Layout
1149 -DLYX_ENABLE_EXPORT_TESTS=ON
1150 \end_layout
1151
1152 \end_inset
1153
1154  flag.
1155  For example:
1156 \end_layout
1157
1158 \begin_layout Standard
1159 \begin_inset Flex Code
1160 status collapsed
1161
1162 \begin_layout Plain Layout
1163 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
1164 \end_layout
1165
1166 \end_inset
1167
1168
1169 \end_layout
1170
1171 \begin_layout Standard
1172 \noindent
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
1176 LatexCommand ref
1177 reference "subsec:Interpreting-export-tests"
1178
1179 \end_inset
1180
1181 ).
1182 \end_layout
1183
1184 \begin_layout Subsubsection
1185 Running the tests
1186 \end_layout
1187
1188 \begin_layout Standard
1189 To run all tests, in the build directory simply run the command 
1190 \begin_inset Flex Code
1191 status collapsed
1192
1193 \begin_layout Plain Layout
1194 ctest
1195 \end_layout
1196
1197 \end_inset
1198
1199 .
1200  To run only some of the tests, use the command 
1201 \begin_inset Flex Code
1202 status collapsed
1203
1204 \begin_layout Plain Layout
1205 ctest -R <pattern>
1206 \end_layout
1207
1208 \end_inset
1209
1210 , where 
1211 \begin_inset Flex Code
1212 status collapsed
1213
1214 \begin_layout Plain Layout
1215 <pattern>
1216 \end_layout
1217
1218 \end_inset
1219
1220  is a regular expression that matches test names.
1221  To run only the export tests, you can use 
1222 \begin_inset Flex Code
1223 status collapsed
1224
1225 \begin_layout Plain Layout
1226 ctest -L export
1227 \end_layout
1228
1229 \end_inset
1230
1231 .
1232  For the list of test categories available in addition to 
1233 \begin_inset Quotes eld
1234 \end_inset
1235
1236 export
1237 \begin_inset Quotes erd
1238 \end_inset
1239
1240 , run 
1241 \begin_inset Flex Code
1242 status collapsed
1243
1244 \begin_layout Plain Layout
1245 ctest \SpecialChar nobreakdash
1246 \SpecialChar nobreakdash
1247 print-labels
1248 \end_layout
1249
1250 \end_inset
1251
1252 .
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
1256 status collapsed
1257
1258 \begin_layout Plain Layout
1259 <pattern>
1260 \end_layout
1261
1262 \end_inset
1263
1264  regular expression did what you expected).
1265  This can be done with the 
1266 \begin_inset Flex Code
1267 status collapsed
1268
1269 \begin_layout Plain Layout
1270 -N
1271 \end_layout
1272
1273 \end_inset
1274
1275  or 
1276 \begin_inset Flex Code
1277 status collapsed
1278
1279 \begin_layout Plain Layout
1280 \SpecialChar nobreakdash
1281 \SpecialChar nobreakdash
1282 show-only
1283 \end_layout
1284
1285 \end_inset
1286
1287  argument.
1288  We are still working on getting the tests to run in parallel which is supported
1289  by the 
1290 \begin_inset Flex Code
1291 status collapsed
1292
1293 \begin_layout Plain Layout
1294 ctest
1295 \end_layout
1296
1297 \end_inset
1298
1299  command with the 
1300 \begin_inset Flex Code
1301 status collapsed
1302
1303 \begin_layout Plain Layout
1304 -j <jobs>
1305 \end_layout
1306
1307 \end_inset
1308
1309  or 
1310 \begin_inset Flex Code
1311 status collapsed
1312
1313 \begin_layout Plain Layout
1314 \SpecialChar nobreakdash
1315 \SpecialChar nobreakdash
1316 parallel <jobs>
1317 \end_layout
1318
1319 \end_inset
1320
1321  argument.
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:
1327 \end_layout
1328
1329 \begin_layout Standard
1330 \begin_inset Flex Code
1331 status collapsed
1332
1333 \begin_layout Plain Layout
1334 ctest -j8
1335 \end_layout
1336
1337 \end_inset
1338
1339
1340 \end_layout
1341
1342 \begin_layout Standard
1343 \begin_inset Flex Code
1344 status collapsed
1345
1346 \begin_layout Plain Layout
1347 ctest \SpecialChar nobreakdash
1348 \SpecialChar nobreakdash
1349 rerun-failed
1350 \end_layout
1351
1352 \end_inset
1353
1354
1355 \end_layout
1356
1357 \begin_layout Standard
1358 \noindent
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
1362 status collapsed
1363
1364 \begin_layout Plain Layout
1365 \noindent
1366 RUN_SERIAL ON
1367 \end_layout
1368
1369 \end_inset
1370
1371  CMake property.
1372 \end_layout
1373
1374 \begin_layout Standard
1375 In some situations the option 
1376 \begin_inset Flex Code
1377 status collapsed
1378
1379 \begin_layout Plain Layout
1380 \SpecialChar nobreakdash
1381 \SpecialChar nobreakdash
1382 timeout <seconds>
1383 \end_layout
1384
1385 \end_inset
1386
1387  is useful.
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
1390  a memory leak).
1391  If a test times out, the 
1392 \begin_inset Flex Code
1393 status collapsed
1394
1395 \begin_layout Plain Layout
1396 ctest
1397 \end_layout
1398
1399 \end_inset
1400
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
1404 status collapsed
1405
1406 \begin_layout Plain Layout
1407 ctest
1408 \end_layout
1409
1410 \end_inset
1411
1412  command.
1413 \end_layout
1414
1415 \begin_layout Subsubsection
1416 \begin_inset CommandInset label
1417 LatexCommand label
1418 name "subsec:Interpreting-export-tests"
1419
1420 \end_inset
1421
1422 Interpreting the export test results
1423 \end_layout
1424
1425 \begin_layout Standard
1426 A test can fail for several reasons, not all of them bad.
1427 \end_layout
1428
1429 \begin_layout Enumerate
1430 The .lyx file could have been added recently and some formats are not expected
1431  to work well.
1432 \end_layout
1433
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
1439 status open
1440
1441 \begin_layout Plain Layout
1442 check_load
1443 \end_layout
1444
1445 \end_inset
1446
1447  test will likely also fail.
1448 \end_layout
1449
1450 \begin_layout Enumerate
1451 An export that previously failed to compile now compiles.
1452 \end_layout
1453
1454 \begin_layout Enumerate
1455 An external dependency was updated (e.g.
1456  TeX Live).
1457 \end_layout
1458
1459 \begin_layout Enumerate
1460 A recent code change introduced a bug.
1461 \end_layout
1462
1463 \begin_layout Enumerate
1464 \begin_inset CommandInset label
1465 LatexCommand label
1466 name "enu:exposed"
1467
1468 \end_inset
1469
1470 A change in a document exposed the incompatibility of that class with an
1471  export format (e.g.
1472  LuaTeX).
1473 \end_layout
1474
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
1480 \end_inset
1481
1482 inverting
1483 \begin_inset Quotes erd
1484 \end_inset
1485
1486  the tests, that is, by marking the test as 
1487 \begin_inset Quotes eld
1488 \end_inset
1489
1490 passing
1491 \begin_inset Quotes erd
1492 \end_inset
1493
1494  if the export exits with error and as 
1495 \begin_inset Quotes eld
1496 \end_inset
1497
1498 failing
1499 \begin_inset Quotes erd
1500 \end_inset
1501
1502  if the export succeeds
1503 \emph on
1504 .
1505
1506 \emph default
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
1510 \end_inset
1511
1512 good
1513 \begin_inset Quotes erd
1514 \end_inset
1515
1516  tests.
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.
1520 \end_layout
1521
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
1526 status collapsed
1527
1528 \begin_layout Plain Layout
1529 #
1530 \end_layout
1531
1532 \end_inset
1533
1534 ) above the block in which the test is listed as inverted or ignored in
1535  the files 
1536 \begin_inset Flex Code
1537 status collapsed
1538
1539 \begin_layout Plain Layout
1540 development/autotests/revertedTests
1541 \end_layout
1542
1543 \end_inset
1544
1545  and 
1546 \begin_inset Flex Code
1547 status collapsed
1548
1549 \begin_layout Plain Layout
1550 development/autotests/ignoredTests
1551 \end_layout
1552
1553 \end_inset
1554
1555 .
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.
1560 \end_layout
1561
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.
1569  
1570 \end_layout
1571
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.
1581 \end_layout
1582
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
1587 status collapsed
1588
1589 \begin_layout Plain Layout
1590 revertedTests
1591 \end_layout
1592
1593 \end_inset
1594
1595  file) in order to preserve the fix.
1596 \end_layout
1597
1598 \begin_layout Standard
1599 When a test or several tests fail, consider checking the files in the 
1600 \begin_inset Flex Code
1601 status collapsed
1602
1603 \begin_layout Plain Layout
1604 Testing/Temporary/
1605 \end_layout
1606
1607 \end_inset
1608
1609  subdirectory of your build directory.
1610  In this subdirectory are three files: the file 
1611 \begin_inset Flex Code
1612 status collapsed
1613
1614 \begin_layout Plain Layout
1615 LastTestsFailed.log
1616 \end_layout
1617
1618 \end_inset
1619
1620  simply lists the tests that failed on your last 
1621 \begin_inset Flex Code
1622 status collapsed
1623
1624 \begin_layout Plain Layout
1625 ctest
1626 \end_layout
1627
1628 \end_inset
1629
1630  command; the 
1631 \begin_inset Flex Code
1632 status collapsed
1633
1634 \begin_layout Plain Layout
1635 LastTest.log
1636 \end_layout
1637
1638 \end_inset
1639
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
1643 status collapsed
1644
1645 \begin_layout Plain Layout
1646 CTestCostData.txt
1647 \end_layout
1648
1649 \end_inset
1650
1651  file lists the times that it took to run the tests.
1652 \end_layout
1653
1654 \begin_layout Subsubsection
1655 Inverted tests
1656 \end_layout
1657
1658 \begin_layout Standard
1659 These tests are expected to always fail.
1660 \end_layout
1661
1662 \begin_layout Description
1663 reverted These tests are expected to fail, but are subject to be examined.
1664  It is expected that they will pass in a foreseeable future.
1665  They are labeled 'reverted'.
1666 \end_layout
1667
1668 \begin_layout Description
1669 suspended Some inverted tests are labeled 'suspended'.
1670  This means, they are not executed using 
1671 \begin_inset Flex Code
1672 status collapsed
1673
1674 \begin_layout Plain Layout
1675 ctest -L export
1676 \end_layout
1677
1678 \end_inset
1679
1680  or 
1681 \begin_inset Flex Code
1682 status collapsed
1683
1684 \begin_layout Plain Layout
1685 ctest -L reverted
1686 \end_layout
1687
1688 \end_inset
1689
1690 .
1691  From time to time they still have to be checked using 
1692 \begin_inset Flex Code
1693 status collapsed
1694
1695 \begin_layout Plain Layout
1696 ctest -L suspended
1697 \end_layout
1698
1699 \end_inset
1700
1701 .
1702 \end_layout
1703
1704 \begin_deeper
1705 \begin_layout Standard
1706 These tests are suspended, because they fail for known reasons which cannot
1707  ATM be resolved.
1708  But it is expected the reason might disappear in the future.
1709  Be it new TL or better handling in \SpecialChar LyX
1710 .
1711 \end_layout
1712
1713 \begin_layout Standard
1714 For ctest commands without the 
1715 \begin_inset Flex Code
1716 status collapsed
1717
1718 \begin_layout Plain Layout
1719 -L
1720 \end_layout
1721
1722 \end_inset
1723
1724  parameter nothing changes.
1725  Suspended or not, tests will be executed depending only on the regexes
1726  parameters given to the ctest command.
1727 \end_layout
1728
1729 \end_deeper
1730 \begin_layout Subsubsection
1731 Unreliable tests
1732 \end_layout
1733
1734 \begin_layout Description
1735 nonstandard In primary sense such test means "requires non-standard ressources
1736  (LaTeX packages and document classes, fonts, ...
1737  that are not a requirement for running this test suite".
1738 \end_layout
1739
1740 \begin_deeper
1741 \begin_layout Standard
1742 In a wider sense, it is currently used also for "not to be expected to succeed
1743  on every site that runs this test suite".
1744  This wider definition includes tests that have "arbitrary" result depending
1745  on local configuration, OS, TeX distribution, package versions, or the
1746  phase of the moon.
1747 \end_layout
1748
1749 \begin_layout Standard
1750 These tests are labeled as 
1751 \family typewriter
1752 'nonstandard'.
1753 \end_layout
1754
1755 \end_deeper
1756 \begin_layout Description
1757 erratic Tests depending on local configuration, OS, TeX distribution, package
1758  versions, or the phase of the moon.
1759 \end_layout
1760
1761 \begin_deeper
1762 \begin_layout Standard
1763 These tests are labeled as 
1764 \family typewriter
1765 'erratic'.
1766 \end_layout
1767
1768 \end_deeper
1769 \begin_layout Subsection
1770 check_load tests
1771 \end_layout
1772
1773 \begin_layout Standard
1774 These tests check whether a .lyx file loads without any terminal messages.
1775  They correspond to the manual operations of simply opening a .lyx file on
1776  the terminal, exiting LyX once the file is loaded, and then checking whether
1777  there is any output from the terminal.
1778  These tests are useful for catching malformed .lyx files and parsing bugs.
1779  They can also be used to find a .lyx file in which an instance of something
1780  happens.
1781  To do this, compile LyX with a local patch that outputs something to the
1782  terminal when an instance is found, and then run the check_load tests to
1783  see if any fail, which would mean that the situation occurs in the LyX
1784  documentation files corresponding to the failed tests.
1785  These tests are expectedly fragile: any LyX diagnostic message, which is
1786  not necessarily an error, would cause the tests to fail.
1787  Similarly, any message output by a library (e.g.
1788  Qt) would also cause failure.
1789  There are some messages that the check_load tests are instructed to ignore,
1790  which are stored in the file 
1791 \begin_inset Flex Code
1792 status collapsed
1793
1794 \begin_layout Plain Layout
1795 development/autotests/filterCheckWarnings
1796 \end_layout
1797
1798 \end_inset
1799
1800 .
1801 \end_layout
1802
1803 \begin_layout Standard
1804 Under cmake, the tests are labeled as 'load'.
1805 \end_layout
1806
1807 \begin_layout Subsection
1808 URL tests (cmake only)
1809 \end_layout
1810
1811 \begin_layout Standard
1812 The URL tests are enabled with the 
1813 \begin_inset Flex Code
1814 status collapsed
1815
1816 \begin_layout Plain Layout
1817 -DLYX_ENABLE_URLTESTS=ON
1818 \end_layout
1819
1820 \end_inset
1821
1822  CMake flag and are useful for finding broken links in our documentation
1823  files.
1824  If a URL test fails, to see which link in particular was reported as broken,
1825  see the output in 
1826 \begin_inset Flex Code
1827 status collapsed
1828
1829 \begin_layout Plain Layout
1830 LastTest.log
1831 \end_layout
1832
1833 \end_inset
1834
1835 .
1836  These tests are extremely fragile (e.g.
1837  a test can depend on your Internet connection) and a failed URL test should
1838  not be taken too seriously.
1839  URL tests are labeled as 
1840 \family typewriter
1841 'url'.
1842 \end_layout
1843
1844 \begin_layout Subsubsection
1845 Running URL tests
1846 \end_layout
1847
1848 \begin_layout Standard
1849 cmake is required to run the \SpecialChar LyX
1850  tests, running them is not implemented for
1851  autotools.
1852 \end_layout
1853
1854 \begin_layout Standard
1855 The appropriate commands are:
1856 \end_layout
1857
1858 \begin_layout Itemize
1859
1860 \family typewriter
1861 ctest -L url
1862 \family default
1863
1864 \begin_inset Newline newline
1865 \end_inset
1866
1867 runns all tests with label 
1868 \family typewriter
1869 'url'
1870 \end_layout
1871
1872 \begin_layout Itemize
1873
1874 \family typewriter
1875 ctest -R 'check_.*urls'
1876 \family default
1877
1878 \begin_inset Newline newline
1879 \end_inset
1880
1881 runns the tests 'check_accessible_urls'
1882 \end_layout
1883
1884 \begin_layout Standard
1885 Associated test results can be examined in ctest-log directory in files
1886  of the form 'LastFailed.*URLS.log'
1887 \end_layout
1888
1889 \begin_layout Subsection
1890 Test labels (cmake only)
1891 \end_layout
1892
1893 \begin_layout Standard
1894 ctest label commands:
1895 \end_layout
1896
1897 \begin_layout Description
1898 \SpecialChar nobreakdash
1899 \SpecialChar nobreakdash
1900 print-labels shows all assigned labels
1901 \end_layout
1902
1903 \begin_layout Description
1904 \SpecialChar nobreakdash
1905 L
1906 \begin_inset space ~
1907 \end_inset
1908
1909 labelname executes all tests to which this label is asigned to.
1910  A test may have more that one label.
1911 \end_layout
1912
1913 \begin_layout Description
1914 \SpecialChar nobreakdash
1915 j
1916 \begin_inset space ~
1917 \end_inset
1918
1919 number executes tests in parallel using 'number' simultaneously processes.
1920  Some tests are marked as 'sequencial', for them this parameter has no effect.
1921 \end_layout
1922
1923 \begin_layout Section
1924 Development policies
1925 \end_layout
1926
1927 \begin_layout Standard
1928 This chapter lists some guidelines that should be followed.
1929  This list is not complete, and many guidelines are in separate chapters,
1930  such as 
1931 \begin_inset Quotes eld
1932 \end_inset
1933
1934 When is an update of the .lyx file format number needed?
1935 \begin_inset Quotes erd
1936 \end_inset
1937
1938  in Section 
1939 \begin_inset CommandInset ref
1940 LatexCommand ref
1941 reference "sec:When-is-an"
1942
1943 \end_inset
1944
1945 .
1946 \end_layout
1947
1948 \begin_layout Subsection
1949 When to set a fixed milestone?
1950 \end_layout
1951
1952 \begin_layout Standard
1953 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
1954  holds:
1955 \end_layout
1956
1957 \begin_layout Enumerate
1958 Somebody is actively working on a fix.
1959 \end_layout
1960
1961 \begin_layout Enumerate
1962 The bug is so severe that it would block the release if it is not fixed.
1963 \end_layout
1964
1965 \begin_layout Standard
1966 If a bug is important, but nobody is working on it, and it is no showstopper,
1967  use a milestone like 2.1.x or 2.2.x.
1968  For all other bugs, do not set a milestone at all.
1969 \end_layout
1970
1971 \begin_layout Subsection
1972 Can we add rc entries in stable branch?
1973 \end_layout
1974
1975 \begin_layout Standard
1976 No.
1977  We are supposed to increase the prefs2prefs version number with such things.
1978 \end_layout
1979
1980 \begin_layout Section
1981 Documentation policies
1982 \end_layout
1983
1984 \begin_layout Standard
1985 The main documentation consists of these files:
1986 \end_layout
1987
1988 \begin_layout Description
1989 splash.lyx it is the first file you see after an installation.
1990  We assume that a new user sees this.
1991  It is therefore designed to be as simple as possible.
1992  Therefore please don't add any new formatting, only fix typos etc.
1993  Splash.lyx is up to date for \SpecialChar LyX
1994  2.1.x, currently maintained by Uwe Stöhr.
1995 \end_layout
1996
1997 \begin_layout Description
1998 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
1999 .
2000  It therefore uses a limited set of formatting.
2001  For example a standard document class.
2002  Since new users will first learn about the formatting possibilities of
2003  \SpecialChar LyX
2004  please keep this file that simple.
2005  Intro.lyx is up to date for \SpecialChar LyX
2006  2.1.x, currently maintained by Uwe Stöhr.
2007 \end_layout
2008
2009 \begin_layout Description
2010 Tutorial.lyx our tutorial.
2011  It must be always up to date.
2012  Normally there is nothing to add since we don't want to overwhelm new users
2013  with too much details.
2014  The will learn these details while using \SpecialChar LyX
2015  and we have special manuals.
2016  Tutorial.lyx is up to date for \SpecialChar LyX
2017  2.1.x, currently maintained by Uwe Stöhr.
2018 \end_layout
2019
2020 \begin_layout Description
2021 UserGuide.lyx our main user guide.
2022  It covers a mixture of basic and detailed information.
2023  Some information is also in the Math and EmbeddedObjects manual so that
2024  the UserGuide refers to these files.
2025  UserGuide.lyx is up to date for \SpecialChar LyX
2026  2.1.x, currently maintained by Uwe Stöhr.
2027 \end_layout
2028
2029 \begin_layout Description
2030 EmbeddedObjects.lyx a special manual to explain things like tables floats
2031  boxes etc.
2032  in all detail.
2033  EmbeddedObjects.lyx is up to date for \SpecialChar LyX
2034  2.1.x, currently maintained by Uwe
2035  Stöhr.
2036 \end_layout
2037
2038 \begin_layout Description
2039 Math.lyx a special manual to explain everything regarding math in all detail.
2040  Math.lyx is up to date for \SpecialChar LyX
2041  2.1.x, currently maintained by Uwe Stöhr.
2042 \end_layout
2043
2044 \begin_layout Description
2045 Additional.lyx this manual covers information that would be too much detail
2046  for the UserGuide or would make the UserGuide uncompilable or only compilable
2047  when installing a lot of special \SpecialChar LaTeX
2048 -packages.
2049  What should be in the UserGuide or better in Additional is a matter of
2050  taste.
2051  it is up to you to decide that.
2052  Additional.lyx is not completely up to date for \SpecialChar LyX
2053  2.1.x.
2054  Only chapter
2055 \begin_inset space ~
2056 \end_inset
2057
2058 8 is up to date and currently maintained by Uwe Stöhr.
2059  It certainly needs a rewrite and update.
2060  For example many info in chapter
2061 \begin_inset space ~
2062 \end_inset
2063
2064 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
2065  manual.
2066 \end_layout
2067
2068 \begin_layout Description
2069 Customization.lyx this manual covers information how to customize \SpecialChar LyX
2070  for certain
2071  output formats, operating systems, languages etc.
2072  It is currently completely out of date and needs a major rewrite and update.
2073  If you do this please assure that your information are given for all OSes
2074  and \SpecialChar LaTeX
2075  distributions (meaning be as objective as possible).
2076 \end_layout
2077
2078 \begin_layout Standard
2079 There are only 4
2080 \begin_inset space ~
2081 \end_inset
2082
2083 rules in editing the docs:
2084 \end_layout
2085
2086 \begin_layout Enumerate
2087 If you are not the maintainer of a doc file or a chapter/section, you MUST
2088  use change tracking so that the maintainer could review your changes
2089 \end_layout
2090
2091 \begin_layout Enumerate
2092 Respect the formatting of the document.
2093  The different files use different formatting styles.
2094  That is OK and has historic reasons nobody fully know ;-).
2095  But it is important to be consistent within one file.
2096 \end_layout
2097
2098 \begin_layout Enumerate
2099 All changes you make to a file in one language MUST also go the file in
2100  the other actively maintained languages.
2101  Normally the maintainer does this for you, if you are the maintainer, you
2102  must do this by copying or changing the changed or added text to the other
2103  files so that the translators sees the blue underlined text and know what
2104  they have to translate and what was changed.
2105 \end_layout
2106
2107 \begin_layout Enumerate
2108 You MUST assure that the document is compilable as 
2109 \begin_inset Quotes eld
2110 \end_inset
2111
2112 PDF (pdflatex)
2113 \begin_inset Quotes erd
2114 \end_inset
2115
2116  after your changes.
2117 \end_layout
2118
2119 \end_body
2120 \end_document