]> git.lyx.org Git - lyx.git/blob - lib/doc/Development.lyx
Update docs for \output_changes move
[lyx.git] / lib / doc / Development.lyx
1 #LyX 2.2 created this file. For more info see http://www.lyx.org/
2 \lyxformat 504
3 \begin_document
4 \begin_header
5 \save_transient_properties true
6 \origin /systemlyxdir/doc/
7 \textclass scrartcl
8 \options BCOR8mm,captions=tableheading
9 \use_default_options false
10 \begin_modules
11 logicalmkup
12 \end_modules
13 \maintain_unincluded_children false
14 \language english
15 \language_package default
16 \inputencoding auto
17 \fontencoding global
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
24 \font_sc false
25 \font_osf false
26 \font_sf_scale 100 100
27 \font_tt_scale 100 100
28 \graphics default
29 \default_output_format pdf2
30 \output_sync 0
31 \bibtex_command default
32 \index_command default
33 \paperfontsize 12
34 \spacing single
35 \use_hyperref true
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"
40 \pdf_bookmarks true
41 \pdf_bookmarksnumbered true
42 \pdf_bookmarksopen true
43 \pdf_bookmarksopenlevel 1
44 \pdf_breaklinks false
45 \pdf_pdfborder false
46 \pdf_colorlinks true
47 \pdf_backref false
48 \pdf_pdfusetitle false
49 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue, pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
50 \papersize a4paper
51 \use_geometry false
52 \use_package amsmath 1
53 \use_package amssymb 1
54 \use_package cancel 0
55 \use_package esint 0
56 \use_package mathdots 1
57 \use_package mathtools 0
58 \use_package mhchem 1
59 \use_package stackrel 0
60 \use_package stmaryrd 0
61 \use_package undertilde 0
62 \cite_engine basic
63 \cite_engine_type default
64 \biblio_style plain
65 \use_bibtopic false
66 \use_indices false
67 \paperorientation portrait
68 \suppress_date false
69 \justification true
70 \use_refstyle 0
71 \notefontcolor #0000ff
72 \index Index
73 \shortcut idx
74 \color #008000
75 \end_index
76 \secnumdepth 4
77 \tocdepth 4
78 \paragraph_separation indent
79 \paragraph_indentation default
80 \quotes_language english
81 \papercolumns 1
82 \papersides 2
83 \paperpagestyle headings
84 \tracking_changes false
85 \output_changes false
86 \html_math_output 0
87 \html_css_as_file 0
88 \html_be_strict true
89 \end_header
90
91 \begin_body
92
93 \begin_layout Title
94 Developing \SpecialChar LyX
95
96 \end_layout
97
98 \begin_layout Subtitle
99 Version 2.2.x
100 \end_layout
101
102 \begin_layout Author
103 by the \SpecialChar LyX
104  Team
105 \begin_inset Foot
106 status collapsed
107
108 \begin_layout Plain Layout
109 \noindent
110 If you have comments or error corrections, please send them to the \SpecialChar LyX
111  Documentatio
112 n mailing list, 
113 \begin_inset Flex Code
114 status collapsed
115
116 \begin_layout Plain Layout
117 \noindent
118 <lyx-docs@lists.lyx.org>
119 \end_layout
120
121 \end_inset
122
123 .
124 \end_layout
125
126 \end_inset
127
128
129 \end_layout
130
131 \begin_layout Standard
132 \begin_inset CommandInset toc
133 LatexCommand tableofcontents
134
135 \end_inset
136
137
138 \end_layout
139
140 \begin_layout Section
141 Introduction
142 \end_layout
143
144 \begin_layout Standard
145 This manual documents some aspects of \SpecialChar LyX
146  development.
147  It is currently rather incomplete, but will hopefully be extended in the
148  future.
149  Meanwhile, additional information can be found in the 
150 \begin_inset Flex Code
151 status collapsed
152
153 \begin_layout Plain Layout
154 development
155 \end_layout
156
157 \end_inset
158
159  subfolder of the \SpecialChar LyX
160  source code distribution.
161  This document is not translated, since the development language of \SpecialChar LyX
162  is
163  English.
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.
170 \end_layout
171
172 \begin_layout Section
173 File formats
174 \end_layout
175
176 \begin_layout Standard
177 \SpecialChar LyX
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
181 tion.
182 \end_layout
183
184 \begin_layout Subsection
185 File Format Numbers
186 \end_layout
187
188 \begin_layout Subsection
189 When is an update of the .lyx file format number needed?
190 \begin_inset CommandInset label
191 LatexCommand label
192 name "sec:When-is-an"
193
194 \end_inset
195
196
197 \end_layout
198
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:
204 \end_layout
205
206 \begin_layout Description
207 New
208 \begin_inset space ~
209 \end_inset
210
211 document
212 \begin_inset space ~
213 \end_inset
214
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,
218  e.
219 \begin_inset space \thinspace{}
220 \end_inset
221
222 g.
223 \begin_inset space \space{}
224 \end_inset
225
226 a new language that is stored in 
227 \begin_inset Flex Code
228 status collapsed
229
230 \begin_layout Plain Layout
231
232 \backslash
233 language
234 \end_layout
235
236 \end_inset
237
238 .
239 \end_layout
240
241 \begin_layout Description
242 Removed
243 \begin_inset space ~
244 \end_inset
245
246 document
247 \begin_inset space ~
248 \end_inset
249
250 setting If a certain setting becomes obsolete and gets removed, a file format
251  update is needed.
252 \end_layout
253
254 \begin_layout Description
255 New
256 \begin_inset space ~
257 \end_inset
258
259 inset Of course a new inset requires a file format update.
260 \end_layout
261
262 \begin_layout Description
263 New
264 \begin_inset space ~
265 \end_inset
266
267 style in any layout file or module shipped with \SpecialChar LyX
268 , or new shipped layout
269  file or module.
270  These requirements are currently under discussion and might change in the
271  future.
272 \end_layout
273
274 \begin_layout Description
275 Automatically
276 \begin_inset space ~
277 \end_inset
278
279 loaded
280 \begin_inset space ~
281 \end_inset
282
283 math
284 \begin_inset space ~
285 \end_inset
286
287 package Any new math package that is automatically loaded needs a file format
288  update.
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
295 status collapsed
296
297 \begin_layout Plain Layout
298 use_package
299 \end_layout
300
301 \end_inset
302
303  header setting.
304 \end_layout
305
306 \begin_layout Standard
307 If you are still unsure, please ask on the development list.
308 \end_layout
309
310 \begin_layout Subsection
311 How to update the file format number of .lyx files
312 \begin_inset CommandInset label
313 LatexCommand label
314 name "subsec:update_lyx_files"
315
316 \end_inset
317
318
319 \end_layout
320
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:
324 \end_layout
325
326 \begin_layout Enumerate
327 Implement and test the new feature, including the reading and writing of
328  .lyx files.
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.
332 \end_layout
333
334 \begin_layout Enumerate
335 Describe the new format in 
336 \begin_inset Flex Code
337 status collapsed
338
339 \begin_layout Plain Layout
340 development/FORMAT
341 \end_layout
342
343 \end_inset
344
345 .
346 \end_layout
347
348 \begin_layout Enumerate
349 Update the \SpecialChar LyX
350  file format number in 
351 \begin_inset Flex Code
352 status collapsed
353
354 \begin_layout Plain Layout
355 src/version.h
356 \end_layout
357
358 \end_inset
359
360 .
361 \end_layout
362
363 \begin_layout Enumerate
364 Update the range of file formats in the array 
365 \begin_inset Flex Code
366 status collapsed
367
368 \begin_layout Plain Layout
369 format_relation
370 \end_layout
371
372 \end_inset
373
374  in 
375 \begin_inset Flex Code
376 status collapsed
377
378 \begin_layout Plain Layout
379 lib/lyx2lyx/LyX.py
380 \end_layout
381
382 \end_inset
383
384 .
385 \end_layout
386
387 \begin_layout Enumerate
388 Add an entry to both format lists (for conversion and reversion) in
389 \begin_inset Newline newline
390 \end_inset
391
392
393 \begin_inset Flex Code
394 status collapsed
395
396 \begin_layout Plain Layout
397 lib/lyx2lyx/lyx_2_2.py
398 \end_layout
399
400 \end_inset
401
402 .
403  Add a conversion routine if needed (e.
404 \begin_inset space \thinspace{}
405 \end_inset
406
407 g.
408 \begin_inset space \space{}
409 \end_inset
410
411 a new header setting always needs a conversion that adds the new setting,
412  a new document language does not need one).
413  Add a reversion routine if needed.
414  While the conversion routine is required to produce a document that is
415  equivalent to the old version, the requirements of the reversion are not
416  that strict.
417  If possible, try to produce a proper reversion, using ERT if needed, but
418  for some features this might be too complicated.
419  In this case, the minimum requirement of the reversion routine is that
420  it produces a valid document which can be read by an older \SpecialChar LyX
421 .
422  If absolutely needed, even data loss is allowed for the reversion.
423 \end_layout
424
425 \begin_layout Enumerate
426 Since tex2lyx has several implicit file format dependencies caused by sharing
427  code with \SpecialChar LyX
428 , updating the file format of .lyx files produced by tex2lyx at
429  the same time as updating the main .lyx file format is strongly recommended.
430  Therefore, a compiler warning will be issued if the \SpecialChar LyX
431  and tex2lyx .lyx file
432  format numbers differ.
433  In many cases the tex2lyx update requires only the first and last item
434  of the list below:
435 \begin_inset Separator parbreak
436 \end_inset
437
438
439 \end_layout
440
441 \begin_deeper
442 \begin_layout Enumerate
443 Update the tex2lyx file format number in 
444 \begin_inset Flex Code
445 status collapsed
446
447 \begin_layout Plain Layout
448 src/version.h
449 \end_layout
450
451 \end_inset
452
453 .
454 \end_layout
455
456 \begin_layout Enumerate
457 If the lyx2lyx conversion from the old to the new format is empty, or if
458  tex2lyx does not yet output the changed feature, you do not need any further
459  tex2lyx changes.
460  Otherwise, search for the changed feature in tex2lyx, and adjust the output
461  according to the lyx2lyx changes.
462 \end_layout
463
464 \begin_layout Enumerate
465 Update the tex2lyx test references as described in 
466 \begin_inset CommandInset ref
467 LatexCommand formatted
468 reference "sec:Updating-test-references"
469
470 \end_inset
471
472 .
473 \end_layout
474
475 \end_deeper
476 \begin_layout Enumerate
477 If you did not implement full tex2lyx support of the new feature, add a
478  line to 
479 \begin_inset Flex Code
480 status collapsed
481
482 \begin_layout Plain Layout
483 src/tex2lyx/TODO.txt
484 \end_layout
485
486 \end_inset
487
488  describing the missing bits.
489  Note that it is perfectly fine if you do not add full tex2lyx support for
490  a new feature: The updating recommendation above is only issued for the
491  syntax of the produced .lyx file.
492  It is no problem if some features supported by \SpecialChar LyX
493  are still output as ERT
494  by tex2lyx, since the problems in the past that resulted in the update
495  recommendation were related to mixed version syntax, not ERT.
496 \end_layout
497
498 \begin_layout Enumerate
499 It would be nice if you could create a .lyx test file which contains instances
500  of all changed or added features.
501  This could then be used to test lyx2lyx and tex2lyx.
502  Unfortunately it has not yet been decided how to collect such examples,
503  so please ask on the development list if you want to create one.
504 \end_layout
505
506 \begin_layout Enumerate
507 \begin_inset CommandInset label
508 LatexCommand label
509 name "enu:updatefiles"
510
511 \end_inset
512
513 Update LyX's .lyx documentation files to the new format.
514  The developer who makes the change knows best what changes to expect when
515  inspecting the resulting diff.
516  Because of this, you might be able to catch a bug in the lyx2lyx code that
517  updates the format just by taking a quick scan through the large diff that
518  is the result
519 \begin_inset Note Note
520 status collapsed
521
522 \begin_layout Plain Layout
523 Another advantage is that if later we suspect a bug in lyx2lyx we can easily
524  see which layout update made an unexpected change by looking at the git
525  log of a .lyx file that suffers the problem.
526 \end_layout
527
528 \end_inset
529
530 .
531  To do this, first make sure that there are no changes to the git repository
532  that you will not want to commit (this is needed because it will be convenient
533  to commit with the command 
534 \begin_inset Flex Code
535 status collapsed
536
537 \begin_layout Plain Layout
538 git commit -a
539 \end_layout
540
541 \end_inset
542
543 ).
544  Then run the following command in the root folder of the source: 
545 \begin_inset Flex Code
546 status collapsed
547
548 \begin_layout Plain Layout
549 python development/tools/updatedocs.py
550 \end_layout
551
552 \end_inset
553
554 .
555  Then, revert the change to 
556 \begin_inset Flex Code
557 status collapsed
558
559 \begin_layout Plain Layout
560 LFUNs.lyx
561 \end_layout
562
563 \end_inset
564
565  because that file is meant to be generated separately: 
566 \begin_inset Flex Code
567 status collapsed
568
569 \begin_layout Plain Layout
570 git checkout lib/doc/LFUNs.lyx
571 \end_layout
572
573 \end_inset
574
575
576 \begin_inset Note Note
577 status collapsed
578
579 \begin_layout Plain Layout
580 TODO: this step should be done within updatedocs.py
581 \end_layout
582
583 \end_inset
584
585 .
586  Look at the resulting changes using the command 
587 \begin_inset Flex Code
588 status collapsed
589
590 \begin_layout Plain Layout
591 git diff
592 \end_layout
593
594 \end_inset
595
596 .
597  If anything looks surprising, please investigate.
598  Finally, commit using 
599 \begin_inset Flex Code
600 status collapsed
601
602 \begin_layout Plain Layout
603 git commit -a
604 \end_layout
605
606 \end_inset
607
608 .
609 \end_layout
610
611 \begin_layout Subsection
612 Updating the file format number of layout files
613 \end_layout
614
615 \begin_layout Standard
616 See step 
617 \begin_inset CommandInset ref
618 LatexCommand ref
619 reference "enu:updatefiles"
620
621 \end_inset
622
623  in section 
624 \begin_inset CommandInset ref
625 LatexCommand ref
626 reference "subsec:update_lyx_files"
627
628 \end_inset
629
630  but instead of the 
631 \begin_inset Flex Code
632 status collapsed
633
634 \begin_layout Plain Layout
635 updatedocs.py
636 \end_layout
637
638 \end_inset
639
640  command, use this command: 
641 \begin_inset Flex Code
642 status collapsed
643
644 \begin_layout Plain Layout
645 python development/tools/updatelayouts.py
646 \end_layout
647
648 \end_inset
649
650 .
651 \end_layout
652
653 \begin_layout Standard
654 Note that we do not update the local layout of our 
655 \begin_inset Flex Code
656 status collapsed
657
658 \begin_layout Plain Layout
659 .lyx
660 \end_layout
661
662 \end_inset
663
664  files because users would then not be able to export to older formats.
665  For example, if a 2.2.0 user exported a template to 2.1.x format and tried
666  to open the file in LyX 2.1.x, there would be an error because the file would
667  contain a local layout whose format is too new.
668  The root reason for this is that we do not support converting layouts to
669  older layout formats, as we do for the 
670 \begin_inset Flex Code
671 status collapsed
672
673 \begin_layout Plain Layout
674 .lyx
675 \end_layout
676
677 \end_inset
678
679  file format.
680 \end_layout
681
682 \begin_layout Subsection
683 Updating the file format number of bind/ui files
684 \end_layout
685
686 \begin_layout Standard
687 See step 
688 \begin_inset CommandInset ref
689 LatexCommand ref
690 reference "enu:updatefiles"
691
692 \end_inset
693
694  in section 
695 \begin_inset CommandInset ref
696 LatexCommand ref
697 reference "subsec:update_lyx_files"
698
699 \end_inset
700
701  but instead of the 
702 \begin_inset Flex Code
703 status collapsed
704
705 \begin_layout Plain Layout
706 updatedocs.py
707 \end_layout
708
709 \end_inset
710
711  command, use this command: 
712 \begin_inset Flex Code
713 status collapsed
714
715 \begin_layout Plain Layout
716 bash development/tools/updatelfuns.sh
717 \end_layout
718
719 \end_inset
720
721 .
722 \end_layout
723
724 \begin_layout Subsection
725 Backporting new styles to the stable version
726 \end_layout
727
728 \begin_layout Standard
729 Starting with the stable \SpecialChar LyX
730  2.1 branch, there is a mechanism in place to backport
731  new styles to the stable version without the need to update the file format.
732  The basic idea is that the new style definition is automatically copied
733  to the document preamble, so that it can even be used by older minor revisions
734  that did not yet include the style.
735  To backport a new style to the stable version, the following steps are
736  needed:
737 \end_layout
738
739 \begin_layout Enumerate
740 Add the line 
741 \begin_inset Flex Code
742 status collapsed
743
744 \begin_layout Plain Layout
745 ForceLocal -1
746 \end_layout
747
748 \end_inset
749
750  to the style definition in the development version.
751 \end_layout
752
753 \begin_layout Enumerate
754 Copy the style definition to the stable version, but use 
755 \begin_inset Flex Code
756 status collapsed
757
758 \begin_layout Plain Layout
759 ForceLocal 1
760 \end_layout
761
762 \end_inset
763
764  instead.
765  If needed adjust the format to the one used by the stable version (see
766  the customization manual for details of the layout file format).
767 \end_layout
768
769 \begin_layout Enumerate
770 For each update of the style in a later stable version, increase the argument
771  of 
772 \begin_inset Flex Code
773 status collapsed
774
775 \begin_layout Plain Layout
776 ForceLocal
777 \end_layout
778
779 \end_inset
780
781  by one (in the stable version, the development version should not be touched).
782 \end_layout
783
784 \begin_layout Standard
785 For details about the 
786 \begin_inset Flex Code
787 status collapsed
788
789 \begin_layout Plain Layout
790 ForceLocal
791 \end_layout
792
793 \end_inset
794
795  flag see the customization manual.
796  No 
797 \begin_inset Flex Code
798 status collapsed
799
800 \begin_layout Plain Layout
801 lyx2lyx
802 \end_layout
803
804 \end_inset
805
806  support is needed for backported styles: Since the style of the development
807  version has an infinite version number, it will always be used.
808  Furthermore, since its version number is less than one, the style will
809  not be written anymore to the document header for files saved by the new
810  version.
811 \end_layout
812
813 \begin_layout Standard
814 \begin_inset Newpage newpage
815 \end_inset
816
817
818 \end_layout
819
820 \begin_layout Section
821 Tests
822 \end_layout
823
824 \begin_layout Standard
825 Automated tests are an important tool to detect bugs and regressions in
826  software development.
827  Some projects like gcc even require each bug fix to be accompanied by a
828  test case for the automatic test suite, that would detect this bug.
829  Testing interactive features automatically is of course very hard, but
830  core functionality like document import and export can be tested quite
831  easily, and some tests of this kind exist.
832 \end_layout
833
834 \begin_layout Subsection
835 unit tests
836 \end_layout
837
838 \begin_layout Standard
839 There are attempts to set up a suite of unit tests for LyX.
840 \end_layout
841
842 \begin_layout Standard
843 TODO: describe what is done and what is still to do.
844 \end_layout
845
846 \begin_layout Subsection
847 tex2lyx tests
848 \end_layout
849
850 \begin_layout Standard
851 The tex2lyx tests are located in the 
852 \begin_inset Flex Code
853 status collapsed
854
855 \begin_layout Plain Layout
856 src/tex2lyx/test
857 \end_layout
858
859 \end_inset
860
861  subfolder of the \SpecialChar LyX
862  source code distribution.
863  The actual testing is performed by the simple python script 
864 \begin_inset Flex Code
865 status collapsed
866
867 \begin_layout Plain Layout
868 src/tex2lyx/test/runtests.py
869 \end_layout
870
871 \end_inset
872
873 .
874  Each test consists of two files: 
875 \begin_inset Flex Code
876 status collapsed
877
878 \begin_layout Plain Layout
879 <test name>.tex
880 \end_layout
881
882 \end_inset
883
884  contains the \SpecialChar LaTeX
885  code that should be tested.
886  
887 \begin_inset Flex Code
888 status collapsed
889
890 \begin_layout Plain Layout
891 <test name>.lyx.lyx
892 \end_layout
893
894 \end_inset
895
896  contains the expected output of tex2lyx.
897  When a test is run, the actual produced output is compared with the stored
898  reference output.
899  The test passes if both are identical.
900  The test machinery is also able to generate a file 
901 \begin_inset Flex Code
902 status collapsed
903
904 \begin_layout Plain Layout
905 <test name>.lyx.tex
906 \end_layout
907
908 \end_inset
909
910  by exporting the produced .lyx file with \SpecialChar LyX
911  again.
912  This may be useful for roundtrip comparisons.
913 \end_layout
914
915 \begin_layout Subsubsection
916 Running the tests
917 \end_layout
918
919 \begin_layout Standard
920 The tex2lyx tests can be run in several ways.
921  When in the 
922 \begin_inset Flex Code
923 status collapsed
924
925 \begin_layout Plain Layout
926 src/tex2lyx
927 \end_layout
928
929 \end_inset
930
931  subfolder of the build directory, the commands 
932 \begin_inset Flex Code
933 status collapsed
934
935 \begin_layout Plain Layout
936 ctest
937 \end_layout
938
939 \end_inset
940
941  (cmake, all platforms), 
942 \begin_inset Flex Code
943 status collapsed
944
945 \begin_layout Plain Layout
946 make test
947 \end_layout
948
949 \end_inset
950
951  (cmake, when using a make based build system and not MSVC) or 
952 \begin_inset Flex Code
953 status collapsed
954
955 \begin_layout Plain Layout
956 make alltests
957 \end_layout
958
959 \end_inset
960
961  (autotools) will run the tex2lyx tests.
962  Alternatively, in the root of the build directory, the command 
963 \begin_inset Flex Code
964 status collapsed
965
966 \begin_layout Plain Layout
967 ctest -R tex2lyx
968 \end_layout
969
970 \end_inset
971
972  runs all tests whose names match the regex 
973 \begin_inset Quotes eld
974 \end_inset
975
976 tex2lyx
977 \begin_inset Quotes erd
978 \end_inset
979
980 .
981  Another way to run the tex2lyx tests in the root build directory is to
982  instead use the command 
983 \begin_inset Flex Code
984 status collapsed
985
986 \begin_layout Plain Layout
987 ctest -L '(cmplyx|roundtrip)'
988 \end_layout
989
990 \end_inset
991
992 , which runs all tests categorized with the label 
993 \begin_inset Quotes eld
994 \end_inset
995
996 roundtrip
997 \begin_inset Quotes erd
998 \end_inset
999
1000  or 
1001 \begin_inset Quotes eld
1002 \end_inset
1003
1004 cmplyx
1005 \begin_inset Quotes erd
1006 \end_inset
1007
1008 .
1009  If a test fails, the differences between the expected and actual results
1010  are output in unified diff format.
1011 \end_layout
1012
1013 \begin_layout Subsubsection
1014 Updating test references
1015 \begin_inset CommandInset label
1016 LatexCommand label
1017 name "sec:Updating-test-references"
1018
1019 \end_inset
1020
1021
1022 \end_layout
1023
1024 \begin_layout Standard
1025 In some cases a changed tex2lyx output is not a test failure, but wanted,
1026  e.
1027 \begin_inset space \thinspace{}
1028 \end_inset
1029
1030 g.
1031 \begin_inset space \space{}
1032 \end_inset
1033
1034 if a tex2lyx bug was fixed, or a new feature was added.
1035  In these cases the stored references need to be updated.
1036  To do so if using autotools, call 
1037 \begin_inset Flex Code
1038 status collapsed
1039
1040 \begin_layout Plain Layout
1041 make updatetests
1042 \end_layout
1043
1044 \end_inset
1045
1046  in the 
1047 \begin_inset Flex Code
1048 status collapsed
1049
1050 \begin_layout Plain Layout
1051 src/tex2lyx
1052 \end_layout
1053
1054 \end_inset
1055
1056  subdirectory of the build directory.
1057  If instead using CMake, call 
1058 \begin_inset Flex Code
1059 status collapsed
1060
1061 \begin_layout Plain Layout
1062 make updatetex2lyxtests
1063 \end_layout
1064
1065 \end_inset
1066
1067  in the build directory or in the 
1068 \begin_inset Flex Code
1069 status collapsed
1070
1071 \begin_layout Plain Layout
1072 src/tex2lyx/test
1073 \end_layout
1074
1075 \end_inset
1076
1077  subdirectory of the build directory.
1078 \begin_inset Foot
1079 status collapsed
1080
1081 \begin_layout Plain Layout
1082 Note that this is a case where a make target in the build directory can
1083  affect the source directory, which might not be advisable.
1084 \end_layout
1085
1086 \end_inset
1087
1088  On Windows do the following:
1089 \end_layout
1090
1091 \begin_layout Itemize
1092 Assure that the path to the python.exe is in your system PATH variable.
1093 \end_layout
1094
1095 \begin_layout Itemize
1096 Double-click on the file 
1097 \begin_inset Flex Code
1098 status collapsed
1099
1100 \begin_layout Plain Layout
1101 updatetex2lyxtests.vcxproj
1102 \end_layout
1103
1104 \end_inset
1105
1106  in the build directory or in the 
1107 \begin_inset Flex Code
1108 status collapsed
1109
1110 \begin_layout Plain Layout
1111 src/tex2lyx/test
1112 \end_layout
1113
1114 \end_inset
1115
1116  subdirectory of your build directory.
1117 \end_layout
1118
1119 \begin_layout Itemize
1120 In the appearing MSVC program right-click on the project 
1121 \family sans
1122 updatetex2lyxtests
1123 \family default
1124  in the project explorer and chose 
1125 \family sans
1126 Create
1127 \family default
1128 .
1129 \end_layout
1130
1131 \begin_layout Standard
1132 For convenience, these commands also produce re-exported roundtrip .lyx.tex
1133  files.
1134  Please examine the changed output carefully before committing the changed
1135  files to the repository: Since the test machinery does not do a roundtrip
1136  test .tex 
1137 \begin_inset Formula $\Rightarrow$
1138 \end_inset
1139
1140  .lyx 
1141 \begin_inset Formula $\Rightarrow$
1142 \end_inset
1143
1144  .tex, and does not compare the produced dvi or pdf output, it assumes that
1145  the stored .lyx reference produces correct output if processed by \SpecialChar LyX
1146 .
1147  There is only one chance to detect wrong output: before committing a new
1148  reference.
1149  Once it is committed, it is quite difficult to verify whether it is correct.
1150 \end_layout
1151
1152 \begin_layout Standard
1153 Please 
1154 \emph on
1155 do not
1156 \emph default
1157  update the test references by opening them with \SpecialChar LyX
1158  or directly running lyx2lyx
1159  on them.
1160  This would not work, since lyx2lyx and \SpecialChar LyX
1161  produce slightly different files
1162  regarding insignificant whitespace and line breaks.
1163 \end_layout
1164
1165 \begin_layout Subsubsection
1166 Adding a new test
1167 \end_layout
1168
1169 \begin_layout Standard
1170 In many cases tests for new features may be added to one of the existing
1171  test files, but sometimes this is not possible or not wanted.
1172  Then a new test file needs to be added:
1173 \end_layout
1174
1175 \begin_layout Enumerate
1176 Create the new file 
1177 \begin_inset Flex Code
1178 status collapsed
1179
1180 \begin_layout Plain Layout
1181 src/tex2lyx/test/<test name>.tex
1182 \end_layout
1183
1184 \end_inset
1185
1186  and run tex2lyx in roundtrip mode to produce the file 
1187 \begin_inset Flex Code
1188 status collapsed
1189
1190 \begin_layout Plain Layout
1191 src/tex2lyx/test/<test name>.lyx.lyx
1192 \end_layout
1193
1194 \end_inset
1195
1196 .
1197  This file will be the new reference.
1198 \end_layout
1199
1200 \begin_layout Enumerate
1201 Once you confirmed that the tex2lyx output is correct, add the new files
1202  to the corresponding lists in 
1203 \begin_inset Flex Code
1204 status collapsed
1205
1206 \begin_layout Plain Layout
1207 src/tex2lyx/test/runtests.py
1208 \end_layout
1209
1210 \end_inset
1211
1212
1213 \begin_inset Flex Code
1214 status collapsed
1215
1216 \begin_layout Plain Layout
1217 src/tex2lyx/Makefile.am
1218 \end_layout
1219
1220 \end_inset
1221
1222  and 
1223 \begin_inset Flex Code
1224 status collapsed
1225
1226 \begin_layout Plain Layout
1227 src/tex2lyx/test/CMakeLists.txt
1228 \end_layout
1229
1230 \end_inset
1231
1232 .
1233 \end_layout
1234
1235 \begin_layout Enumerate
1236 Commit the changes to the repository, or send a patch to the development
1237  list and ask for committing if you do not have commit rights.
1238 \end_layout
1239
1240 \begin_layout Subsection
1241 ctest automatic tests (cmake only)
1242 \end_layout
1243
1244 \begin_layout Standard
1245 Some tests are located in the 
1246 \begin_inset Flex Code
1247 status collapsed
1248
1249 \begin_layout Plain Layout
1250 development/autotests
1251 \end_layout
1252
1253 \end_inset
1254
1255  subfolder of the \SpecialChar LyX
1256  source code distribution.
1257  
1258 \begin_inset Flex Code
1259 status collapsed
1260
1261 \begin_layout Plain Layout
1262 cmake
1263 \end_layout
1264
1265 \end_inset
1266
1267  is required to run the automatic \SpecialChar LyX
1268  tests, running them is not implemented
1269  for autotools.
1270  
1271 \end_layout
1272
1273 \begin_layout Standard
1274 The \SpecialChar LyX
1275  tests can be run by the commands 
1276 \begin_inset Flex Code
1277 status collapsed
1278
1279 \begin_layout Plain Layout
1280 ctest
1281 \end_layout
1282
1283 \end_inset
1284
1285  (all platforms) or 
1286 \begin_inset Flex Code
1287 status collapsed
1288
1289 \begin_layout Plain Layout
1290 make test
1291 \end_layout
1292
1293 \end_inset
1294
1295  (when using a make based build system and not MSVC) in the 
1296 \begin_inset Flex Code
1297 status collapsed
1298
1299 \begin_layout Plain Layout
1300 autotests
1301 \end_layout
1302
1303 \end_inset
1304
1305  subfolder of the build directory.
1306 \end_layout
1307
1308 \begin_layout Subsubsection
1309 Export tests 
1310 \end_layout
1311
1312 \begin_layout Standard
1313 The export tests are integration tests.
1314  They take longer to run and are more likely to break than the tex2lyx tests.
1315  Nevertheless, they have caught many regressions and without a better alternativ
1316 e it is important to keep them up-to-date and understand how they work.
1317 \end_layout
1318
1319 \begin_layout Standard
1320 The export tests 
1321 \begin_inset Quotes eld
1322 \end_inset
1323
1324 reuse
1325 \begin_inset Quotes erd
1326 \end_inset
1327
1328  documentation, template, and example files trying to export them to all
1329  supported output formats.
1330  In addition, there are a number of dedicated sample documents under 
1331 \begin_inset Flex Code
1332 status collapsed
1333
1334 \begin_layout Plain Layout
1335 autotests/export/
1336 \end_layout
1337
1338 \end_inset
1339
1340 .
1341 \end_layout
1342
1343 \begin_layout Paragraph
1344 Expectations of LyX developers
1345 \end_layout
1346
1347 \begin_layout Standard
1348 Because the export tests are integration tests and take a long time to run,
1349  LyX developers are rarely expected to run all of the tests.
1350  Here are some good practices to follow by developers:
1351 \end_layout
1352
1353 \begin_layout Itemize
1354 When making a non-trivial change to a .layout file, run the export and layout
1355  tests corresponding with that .layout file.
1356 \end_layout
1357
1358 \begin_layout Itemize
1359 When making non-trivial changes to a .lyx file, run the export tests correspondin
1360 g to that .lyx file.
1361 \end_layout
1362
1363 \begin_layout Itemize
1364 When making non-trivial changes to LyX's \SpecialChar LaTeX
1365  export code (e.g.
1366  touching the encoding code or package handling code that you expect will
1367  change the exported \SpecialChar LaTeX
1368  in some way):
1369 \end_layout
1370
1371 \begin_deeper
1372 \begin_layout Standard
1373 \paragraph_spacing single
1374 Consider running all of the export tests before and after your change.
1375  If there are differences, please reconcile these (i.e.
1376  fix the bug or fix the tests) 
1377 \emph on
1378 before
1379 \emph default
1380  committing.
1381  Ask for help if you're not sure what to.
1382 \end_layout
1383
1384 \begin_layout Standard
1385 If you do not want to run the tests,
1386 \end_layout
1387
1388 \begin_layout Itemize
1389 post the patch on the list and others will run the tests and eventually
1390  ask for fixes, or
1391 \end_layout
1392
1393 \begin_layout Itemize
1394 commit, but be prepared to fix eventually arising problems or to revert
1395  the commit if there is no easy fix.
1396 \end_layout
1397
1398 \end_deeper
1399 \begin_layout Itemize
1400 Understand how to interpret test failures.
1401  If your commit is found to have broken a test, you should be able to interpret
1402  the test results when made aware of them.
1403  See Section 
1404 \begin_inset CommandInset ref
1405 LatexCommand ref
1406 reference "subsec:Interpreting-export-tests"
1407
1408 \end_inset
1409
1410 .
1411 \end_layout
1412
1413 \begin_layout Paragraph
1414 \begin_inset CommandInset label
1415 LatexCommand label
1416 name "par:Configuring-ctests"
1417
1418 \end_inset
1419
1420 Configuring the tests 
1421 \end_layout
1422
1423 \begin_layout Standard
1424 To enable the export autotests, add the 
1425 \begin_inset Flex Code
1426 status collapsed
1427
1428 \begin_layout Plain Layout
1429 -DLYX_ENABLE_EXPORT_TESTS=ON
1430 \end_layout
1431
1432 \end_inset
1433
1434  flag.
1435  For example:
1436 \end_layout
1437
1438 \begin_layout Standard
1439 \begin_inset Flex Code
1440 status collapsed
1441
1442 \begin_layout Plain Layout
1443 cmake -DLYX_ENABLE_EXPORT_TESTS=ON /path/to/source
1444 \end_layout
1445
1446 \end_inset
1447
1448
1449 \end_layout
1450
1451 \begin_layout Standard
1452 \noindent
1453 This flag will increase the time for the cmake command by several seconds,
1454  mainly because of the process of inverting tests (see Section 
1455 \begin_inset CommandInset ref
1456 LatexCommand ref
1457 reference "subsec:Interpreting-export-tests"
1458
1459 \end_inset
1460
1461 ).
1462 \end_layout
1463
1464 \begin_layout Paragraph
1465 Running the tests
1466 \end_layout
1467
1468 \begin_layout Standard
1469 To run all tests, in the build directory simply run the command 
1470 \begin_inset Flex Code
1471 status collapsed
1472
1473 \begin_layout Plain Layout
1474 ctest
1475 \end_layout
1476
1477 \end_inset
1478
1479 .
1480  
1481 \end_layout
1482
1483 \begin_layout Standard
1484 To run only some of the tests, use command line options:
1485 \end_layout
1486
1487 \begin_layout Labeling
1488 \labelwidthstring -R
1489 \begin_inset Flex Code
1490 status collapsed
1491
1492 \begin_layout Plain Layout
1493 -R <pattern>
1494 \end_layout
1495
1496 \end_inset
1497
1498  Run only the tests whose names match the given regular expression.
1499 \end_layout
1500
1501 \begin_layout Labeling
1502 \labelwidthstring -R
1503 \begin_inset Flex Code
1504 status collapsed
1505
1506 \begin_layout Plain Layout
1507 -L <pattern>
1508 \end_layout
1509
1510 \end_inset
1511
1512  Run only the tests whose labels match the given regular expression.
1513  A test may have more that one label.
1514  
1515 \end_layout
1516
1517 \begin_deeper
1518 \begin_layout Standard
1519 For example, to run only the export tests, you can use 
1520 \begin_inset Flex Code
1521 status collapsed
1522
1523 \begin_layout Plain Layout
1524 ctest -L export
1525 \end_layout
1526
1527 \end_inset
1528
1529 .
1530 \end_layout
1531
1532 \end_deeper
1533 \begin_layout Labeling
1534 \labelwidthstring -R
1535 \begin_inset Flex Code
1536 status collapsed
1537
1538 \begin_layout Plain Layout
1539 -E <pattern>
1540 \end_layout
1541
1542 \end_inset
1543
1544  Exclude the tests whose names match the given regular expression.
1545 \end_layout
1546
1547 \begin_layout Labeling
1548 \labelwidthstring -R
1549 \begin_inset Flex Code
1550 status collapsed
1551
1552 \begin_layout Plain Layout
1553 -LE <pattern>
1554 \end_layout
1555
1556 \end_inset
1557
1558  Exclude the tests whose labels match the given regular expression.
1559 \end_layout
1560
1561 \begin_layout Standard
1562 The following options help to find good selection patterns:
1563 \end_layout
1564
1565 \begin_layout Labeling
1566 \labelwidthstring -R
1567 \begin_inset Flex Code
1568 status collapsed
1569
1570 \begin_layout Plain Layout
1571 -N
1572 \end_layout
1573
1574 \end_inset
1575
1576  List the tests that would be run but not actually run them.
1577  
1578 \end_layout
1579
1580 \begin_deeper
1581 \begin_layout Standard
1582 Useful in conjunction with the -R, -L, -E and -LE options, e.g., if you want
1583  to know how many tests there are or whether your 
1584 \begin_inset Flex Code
1585 status collapsed
1586
1587 \begin_layout Plain Layout
1588 <pattern>
1589 \end_layout
1590
1591 \end_inset
1592
1593  regular expression did what you expected.
1594 \end_layout
1595
1596 \end_deeper
1597 \begin_layout Labeling
1598 \labelwidthstring -R
1599 \begin_inset Flex Code
1600 status collapsed
1601
1602 \begin_layout Plain Layout
1603 \SpecialChar nobreakdash
1604 \SpecialChar nobreakdash
1605 print-labels
1606 \end_layout
1607
1608 \end_inset
1609
1610  print the list of all labels associated with the test set.
1611  Can also be combined with -R, -L, -E, ...
1612  
1613 \end_layout
1614
1615 \begin_layout Standard
1616 Other relevant options are:
1617 \end_layout
1618
1619 \begin_layout Labeling
1620 \labelwidthstring -R
1621 \begin_inset Flex Code
1622 status collapsed
1623
1624 \begin_layout Plain Layout
1625 -j <jobs>
1626 \end_layout
1627
1628 \end_inset
1629
1630  Run the tests in parallel using the given number of jobs.
1631 \end_layout
1632
1633 \begin_deeper
1634 \begin_layout Standard
1635 We are still working on getting the tests to run in parallel.
1636  However, when running the tests in parallel, sometimes tests fail that
1637  pass when run sequentially.
1638  A reasonable approach is to first run the tests in parallel and then run
1639  the failed tests sequentially.
1640  
1641 \end_layout
1642
1643 \begin_layout Standard
1644 For example, to run 8 jobs at a time:
1645 \end_layout
1646
1647 \begin_layout Standard
1648 \begin_inset Flex Code
1649 status collapsed
1650
1651 \begin_layout Plain Layout
1652 ctest -j8
1653 \end_layout
1654
1655 \end_inset
1656
1657
1658 \end_layout
1659
1660 \begin_layout Standard
1661 \begin_inset Flex Code
1662 status collapsed
1663
1664 \begin_layout Plain Layout
1665 ctest \SpecialChar nobreakdash
1666 \SpecialChar nobreakdash
1667 rerun-failed
1668 \end_layout
1669
1670 \end_inset
1671
1672
1673 \end_layout
1674
1675 \begin_layout Standard
1676 \noindent
1677 Note that some tests cannot be run in parallel.
1678  These tests are marked in the code with the 
1679 \begin_inset Flex Code
1680 status collapsed
1681
1682 \begin_layout Plain Layout
1683 \noindent
1684 RUN_SERIAL ON
1685 \end_layout
1686
1687 \end_inset
1688
1689  CMake property.
1690 \end_layout
1691
1692 \end_deeper
1693 \begin_layout Labeling
1694 \labelwidthstring -R
1695 \begin_inset Flex Code
1696 status collapsed
1697
1698 \begin_layout Plain Layout
1699 \SpecialChar nobreakdash
1700 \SpecialChar nobreakdash
1701 timeout <seconds>
1702 \end_layout
1703
1704 \end_inset
1705
1706  Set a global timeout on all tests that do not already have a timeout set
1707  on them.
1708 \end_layout
1709
1710 \begin_deeper
1711 \begin_layout Standard
1712 There have been bugs in LyX and in \SpecialChar LaTeX
1713  which cause compilation to hang, and
1714  without a timeout a test might never stop (in one case there was even a
1715  memory leak).
1716  If a test times out, the 
1717 \begin_inset Flex Code
1718 status collapsed
1719
1720 \begin_layout Plain Layout
1721 ctest
1722 \end_layout
1723
1724 \end_inset
1725
1726  command exits with error, but you can distinguish between a timed out test
1727  and a failed test in the output reported at the end of the 
1728 \begin_inset Flex Code
1729 status collapsed
1730
1731 \begin_layout Plain Layout
1732 ctest
1733 \end_layout
1734
1735 \end_inset
1736
1737  command.
1738 \end_layout
1739
1740 \end_deeper
1741 \begin_layout Standard
1742 See the manual (
1743 \begin_inset Flex Code
1744 status collapsed
1745
1746 \begin_layout Plain Layout
1747 man ctest
1748 \end_layout
1749
1750 \end_inset
1751
1752 ) the full list of command line options.
1753 \end_layout
1754
1755 \begin_layout Paragraph
1756 \begin_inset CommandInset label
1757 LatexCommand label
1758 name "subsec:Interpreting-export-tests"
1759
1760 \end_inset
1761
1762 Interpreting the export test results
1763 \end_layout
1764
1765 \begin_layout Standard
1766 A test can fail for several reasons, not all of them bad.
1767 \end_layout
1768
1769 \begin_layout Enumerate
1770 The .lyx file could have been added recently and some formats are not expected
1771  to work well.
1772 \end_layout
1773
1774 \begin_layout Enumerate
1775 A dependency is not met (e.g.
1776  the \SpecialChar LaTeX
1777  class file).
1778  One hint that this is the case is that the corresponding 
1779 \begin_inset Flex Code
1780 status collapsed
1781
1782 \begin_layout Plain Layout
1783 check_load
1784 \end_layout
1785
1786 \end_inset
1787
1788  test will likely also fail.
1789 \end_layout
1790
1791 \begin_layout Enumerate
1792 An inverted test fails to fail (i.e.
1793  export that previously failed now works).
1794 \end_layout
1795
1796 \begin_layout Enumerate
1797 An external dependency was updated (e.g.
1798  \SpecialChar TeX
1799  Live).
1800 \end_layout
1801
1802 \begin_layout Enumerate
1803 A recent code change introduced a bug.
1804 \end_layout
1805
1806 \begin_layout Enumerate
1807 \begin_inset CommandInset label
1808 LatexCommand label
1809 name "enu:exposed"
1810
1811 \end_inset
1812
1813 A change in a document exposed a previously unknown bug or an incompatibility
1814  with an export format (e.g.
1815  Lua\SpecialChar LaTeX
1816 ).
1817 \end_layout
1818
1819 \begin_layout Standard
1820 Because the .lyx files are exported in several formats, it is not surprising
1821  that many of the exports fail.
1822  This expectation of failure is addressed by 
1823 \begin_inset Quotes eld
1824 \end_inset
1825
1826 inverting
1827 \begin_inset Quotes erd
1828 \end_inset
1829
1830  the tests, that is, by marking the test as 
1831 \begin_inset Quotes eld
1832 \end_inset
1833
1834 passing
1835 \begin_inset Quotes erd
1836 \end_inset
1837
1838  if the export exits with error and as 
1839 \begin_inset Quotes eld
1840 \end_inset
1841
1842 failing
1843 \begin_inset Quotes erd
1844 \end_inset
1845
1846  if the export succeeds
1847 \emph on
1848 .
1849
1850 \emph default
1851  It follows that these expected failures will not show up as failed tests
1852  in the test results and thus will not pollute the 
1853 \begin_inset Quotes eld
1854 \end_inset
1855
1856 good
1857 \begin_inset Quotes erd
1858 \end_inset
1859
1860  tests.
1861  If the export actually succeeds, then the test will fail.
1862  The purpose of this failure is to get your attention—something has changed,
1863  possibly for the better.
1864 \end_layout
1865
1866 \begin_layout Standard
1867 We try to document why a test is inverted or ignored.
1868  See the comment (prefixed with 
1869 \begin_inset Flex Code
1870 status collapsed
1871
1872 \begin_layout Plain Layout
1873 #
1874 \end_layout
1875
1876 \end_inset
1877
1878 ) above the block in which the test is listed as inverted or ignored in
1879  the files 
1880 \begin_inset Flex Code
1881 status collapsed
1882
1883 \begin_layout Plain Layout
1884 development/autotests/suspiciousTests
1885 \end_layout
1886
1887 \end_inset
1888
1889  and 
1890 \begin_inset Flex Code
1891 status collapsed
1892
1893 \begin_layout Plain Layout
1894 development/autotests/ignoredTests
1895 \end_layout
1896
1897 \end_inset
1898
1899 .
1900  It is possible that an export goes from succeeding to failing just because
1901  the document was changed and the document was never expected to work with
1902  a certain export format in the first case.
1903  Once this is confirmed to be the situation, the test can be inverted.
1904 \end_layout
1905
1906 \begin_layout Standard
1907 A good question is why do we enable the tests for non-default formats? The
1908  answer is that if a non-default route is broken it is often because a bug
1909  was introduced in LyX and not because a document-specific change was made
1910  that is not supported by the route.
1911  In other words, there is a high signal/noise ratio in the export tests
1912  for some non-default formats.
1913  
1914 \end_layout
1915
1916 \begin_layout Standard
1917 What action should you take if a test fails? This depends:
1918 \end_layout
1919
1920 \begin_layout Standard
1921 Generally, if a change breaks compilation for the target format (for the
1922  manuals pdf2) without solving some important other issue, fix or revert
1923  the commit that led to failure.
1924  If a change breaks compilation for some non-target format (for the manuals
1925  everything except pdf2), invert the test.
1926  
1927 \end_layout
1928
1929 \begin_layout Standard
1930 A special case is given, if the export was succeeding before but showing
1931  garbled text in the PDF output.
1932  Try to establish, that when the compilation succeeded before the resulting
1933  PDF was good.
1934  Otherwise, it is in fact an improvement when a test fails.
1935  Now it might fail with a clear message of "language xyz not supported".
1936  It is always good to check manually why something fails and if it passes
1937  if the PDF output is good.
1938 \end_layout
1939
1940 \begin_layout Standard
1941 Sometimes a test is fixed as side-effect of some change.
1942  We should uninvert a test (remove it from the 
1943 \begin_inset Flex Code
1944 status collapsed
1945
1946 \begin_layout Plain Layout
1947 suspiciousTests
1948 \end_layout
1949
1950 \end_inset
1951
1952  file) in order to preserve the fix.
1953 \end_layout
1954
1955 \begin_layout Standard
1956 When a test or several tests fail, consider checking the files in the 
1957 \begin_inset Flex Code
1958 status collapsed
1959
1960 \begin_layout Plain Layout
1961 Testing/Temporary/
1962 \end_layout
1963
1964 \end_inset
1965
1966  subdirectory of your build directory.
1967  In this subdirectory are three files: the file 
1968 \begin_inset Flex Code
1969 status collapsed
1970
1971 \begin_layout Plain Layout
1972 LastTestsFailed.log
1973 \end_layout
1974
1975 \end_inset
1976
1977  simply lists the tests that failed on your last 
1978 \begin_inset Flex Code
1979 status collapsed
1980
1981 \begin_layout Plain Layout
1982 ctest
1983 \end_layout
1984
1985 \end_inset
1986
1987  command; the 
1988 \begin_inset Flex Code
1989 status collapsed
1990
1991 \begin_layout Plain Layout
1992 LastTest.log
1993 \end_layout
1994
1995 \end_inset
1996
1997  file contains the output from the tests (and often has details explaining
1998  why a test failed); and the 
1999 \begin_inset Flex Code
2000 status collapsed
2001
2002 \begin_layout Plain Layout
2003 CTestCostData.txt
2004 \end_layout
2005
2006 \end_inset
2007
2008  file lists the times that it took to run the tests.
2009 \end_layout
2010
2011 \begin_layout Paragraph
2012 Inverted tests
2013 \end_layout
2014
2015 \begin_layout Standard
2016 These tests fail if the export does 
2017 \emph on
2018 not
2019 \emph default
2020  return an error.
2021  
2022 \end_layout
2023
2024 \begin_layout Description
2025 inverted Export fails, but the test cases are subject to be examined.
2026  It is expected that the export will work in a foreseeable future.
2027  They are labeled 'inverted'.
2028 \end_layout
2029
2030 \begin_layout Description
2031 suspended Some inverted tests are labeled 'suspended'.
2032  This means, they are not executed using 
2033 \begin_inset Flex Code
2034 status collapsed
2035
2036 \begin_layout Plain Layout
2037 ctest -L export
2038 \end_layout
2039
2040 \end_inset
2041
2042  or 
2043 \begin_inset Flex Code
2044 status collapsed
2045
2046 \begin_layout Plain Layout
2047 ctest -L inverted
2048 \end_layout
2049
2050 \end_inset
2051
2052 .
2053  From time to time they still have to be checked using 
2054 \begin_inset Flex Code
2055 status collapsed
2056
2057 \begin_layout Plain Layout
2058 ctest -L suspended
2059 \end_layout
2060
2061 \end_inset
2062
2063 .
2064 \end_layout
2065
2066 \begin_deeper
2067 \begin_layout Standard
2068 These tests are suspended, because the export fails for known reasons which
2069  cannot ATM be resolved.
2070  But it is expected the reason might disappear in the future.
2071  Be it new TL or better handling in \SpecialChar LyX
2072 .
2073 \end_layout
2074
2075 \begin_layout Standard
2076 For ctest commands without the 
2077 \begin_inset Flex Code
2078 status collapsed
2079
2080 \begin_layout Plain Layout
2081 -L
2082 \end_layout
2083
2084 \end_inset
2085
2086  parameter nothing changes.
2087  Suspended or not, tests will be executed depending only on the regexes
2088  parameters given to the ctest command.
2089 \end_layout
2090
2091 \end_deeper
2092 \begin_layout Paragraph
2093 Unreliable tests
2094 \end_layout
2095
2096 \begin_layout Standard
2097 These tests are not executed using 
2098 \begin_inset Flex Code
2099 status collapsed
2100
2101 \begin_layout Plain Layout
2102 ctest -L export
2103 \end_layout
2104
2105 \end_inset
2106
2107  or 
2108 \begin_inset Flex Code
2109 status collapsed
2110
2111 \begin_layout Plain Layout
2112 ctest -L inverted
2113 \end_layout
2114
2115 \end_inset
2116
2117 .
2118  
2119 \end_layout
2120
2121 \begin_layout Standard
2122 They pass or fail for various reasons not related to LyX (nonstandard, erratic)
2123  or pass but should rather fail (wrong output).
2124 \end_layout
2125
2126 \begin_layout Description
2127 nonstandard Documents with additional requirements, e.g.
2128  a class or package file not on CTAN.
2129  
2130 \begin_inset Note Note
2131 status open
2132
2133 \begin_layout Plain Layout
2134 TODO: rename to "extra"?
2135 \end_layout
2136
2137 \end_inset
2138
2139
2140 \end_layout
2141
2142 \begin_deeper
2143 \begin_layout Standard
2144 These tests are labeled as 
2145 \family typewriter
2146 'nonstandard'.
2147 \end_layout
2148
2149 \end_deeper
2150 \begin_layout Description
2151 erratic Tests depending on local configuration, OS, TeX distribution, package
2152  versions, or the phase of the moon.
2153  
2154 \begin_inset Note Note
2155 status open
2156
2157 \begin_layout Plain Layout
2158 TODO: use 
2159 \emph on
2160 erratic
2161 \emph default
2162  only for the phase-of-moon dependency.
2163 \end_layout
2164
2165 \end_inset
2166
2167
2168 \end_layout
2169
2170 \begin_deeper
2171 \begin_layout Standard
2172 These tests are labeled as 
2173 \family typewriter
2174 'erratic'.
2175 \end_layout
2176
2177 \end_deeper
2178 \begin_layout Description
2179 wrong
2180 \begin_inset space ~
2181 \end_inset
2182
2183 output Export does not fail but the resulting document has errors.
2184 \end_layout
2185
2186 \begin_deeper
2187 \begin_layout Standard
2188 \paragraph_spacing single
2189 These tests are actually not 
2190 \emph on
2191 unreliable
2192 \emph default
2193  but 
2194 \emph on
2195 invalid
2196 \emph default
2197  (not measuring what they should measure).
2198 \end_layout
2199
2200 \end_deeper
2201 \begin_layout Paragraph
2202 Export test filtering
2203 \end_layout
2204
2205 \begin_layout Standard
2206 The assignment of a label to a test is controlled by a set of files with
2207  regular expressions that are matched against the test names.
2208 \end_layout
2209
2210 \begin_layout Description
2211 ignoredTests (small file)
2212 \begin_inset Newline newline
2213 \end_inset
2214
2215 Tests selected here are withdrawn in the configuration step (cf.
2216  
2217 \begin_inset CommandInset ref
2218 LatexCommand ref
2219 reference "par:Configuring-ctests"
2220
2221 \end_inset
2222
2223 ).
2224 \end_layout
2225
2226 \begin_deeper
2227 \begin_layout Labeling
2228 \labelwidthstring 00.00.0000
2229 Input Test of any export combination
2230 \end_layout
2231
2232 \begin_layout Labeling
2233 \labelwidthstring 00.00.0000
2234 Output Stop if tests not selected here
2235 \end_layout
2236
2237 \end_deeper
2238 \begin_layout Description
2239 unreliableTests: Tests selected either pass or fail, but that is dependent
2240  on the system where the test is run.
2241  Selected tests gain the label 'unreliable'.
2242 \end_layout
2243
2244 \begin_deeper
2245 \begin_layout Labeling
2246 \labelwidthstring 00.00.0000
2247 Input Each test which passed 'ignoredTests'
2248 \end_layout
2249
2250 \begin_layout Labeling
2251 \labelwidthstring 00.00.0000
2252 Output Stop if test selected, gain label 'unreliable'.
2253 \end_layout
2254
2255 \end_deeper
2256 \begin_layout Description
2257 suspiciousTests 
2258 \begin_inset space \space{}
2259 \end_inset
2260
2261
2262 \end_layout
2263
2264 \begin_deeper
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 Input Each test which passed 'unreliableTests'
2268 \end_layout
2269
2270 \begin_layout Labeling
2271 \labelwidthstring 00.00.0000
2272 Output Stop if not selected.
2273 \end_layout
2274
2275 \begin_layout Standard
2276 The following file is meant as subselections of 'suspiciousTests'.
2277  If neither subselection applies, test gains labels 'export' and 'inverted'
2278 \end_layout
2279
2280 \begin_layout Description
2281 suspendedTests Tests selected here gain the label 'suspended' but _not_
2282  'export' or 'inverted', although in ctest they remain inverted.
2283  ('ctest' knows only 'inverted' or not, labels are used only for test selection)
2284 \end_layout
2285
2286 \begin_deeper
2287 \begin_layout Labeling
2288 \labelwidthstring 00.00.0000
2289 Input Each test selected by 'suspiciousTests' 
2290 \end_layout
2291
2292 \begin_layout Labeling
2293 \labelwidthstring 00.00.0000
2294 Output Selected test gains label 'suspended'.
2295  
2296 \end_layout
2297
2298 \end_deeper
2299 \end_deeper
2300 \begin_layout Standard
2301 The following table may clarify label assignement
2302 \end_layout
2303
2304 \begin_layout Standard
2305 \begin_inset Tabular
2306 <lyxtabular version="3" rows="7" columns="12">
2307 <features tabularvalignment="middle">
2308 <column alignment="left" valignment="top" width="0pt">
2309 <column alignment="left" valignment="top" width="0pt">
2310 <column alignment="left" valignment="top" width="0pt">
2311 <column alignment="left" valignment="top" width="0pt">
2312 <column alignment="center" valignment="top">
2313 <column alignment="center" valignment="top">
2314 <column alignment="center" valignment="top">
2315 <column alignment="center" valignment="top">
2316 <column alignment="center" valignment="top">
2317 <column alignment="center" valignment="top">
2318 <column alignment="center" valignment="top">
2319 <column alignment="center" valignment="top">
2320 <row>
2321 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2322 \begin_inset Text
2323
2324 \begin_layout Plain Layout
2325 Test found in file:
2326 \end_layout
2327
2328 \end_inset
2329 </cell>
2330 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2331 \begin_inset Text
2332
2333 \begin_layout Plain Layout
2334
2335 \end_layout
2336
2337 \end_inset
2338 </cell>
2339 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2340 \begin_inset Text
2341
2342 \begin_layout Plain Layout
2343
2344 \end_layout
2345
2346 \end_inset
2347 </cell>
2348 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2349 \begin_inset Text
2350
2351 \begin_layout Plain Layout
2352
2353 \end_layout
2354
2355 \end_inset
2356 </cell>
2357 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2358 \begin_inset Text
2359
2360 \begin_layout Plain Layout
2361 Marked in ctest, Assigned label
2362 \end_layout
2363
2364 \end_inset
2365 </cell>
2366 <cell multicolumn="2" alignment="center" valignment="top" usebox="none">
2367 \begin_inset Text
2368
2369 \begin_layout Plain Layout
2370
2371 \end_layout
2372
2373 \end_inset
2374 </cell>
2375 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2376 \begin_inset Text
2377
2378 \begin_layout Plain Layout
2379
2380 \end_layout
2381
2382 \end_inset
2383 </cell>
2384 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2385 \begin_inset Text
2386
2387 \begin_layout Plain Layout
2388
2389 \end_layout
2390
2391 \end_inset
2392 </cell>
2393 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2394 \begin_inset Text
2395
2396 \begin_layout Plain Layout
2397
2398 \end_layout
2399
2400 \end_inset
2401 </cell>
2402 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2403 \begin_inset Text
2404
2405 \begin_layout Plain Layout
2406
2407 \end_layout
2408
2409 \end_inset
2410 </cell>
2411 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2412 \begin_inset Text
2413
2414 \begin_layout Plain Layout
2415
2416 \end_layout
2417
2418 \end_inset
2419 </cell>
2420 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2421 \begin_inset Text
2422
2423 \begin_layout Plain Layout
2424
2425 \end_layout
2426
2427 \end_inset
2428 </cell>
2429 </row>
2430 <row>
2431 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2432 \begin_inset Text
2433
2434 \begin_layout Plain Layout
2435 Ignored
2436 \end_layout
2437
2438 \end_inset
2439 </cell>
2440 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2441 \begin_inset Text
2442
2443 \begin_layout Plain Layout
2444 Unreliable
2445 \end_layout
2446
2447 \end_inset
2448 </cell>
2449 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2450 \begin_inset Text
2451
2452 \begin_layout Plain Layout
2453 Suspicious
2454 \end_layout
2455
2456 \end_inset
2457 </cell>
2458 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2459 \begin_inset Text
2460
2461 \begin_layout Plain Layout
2462 Suspended
2463 \end_layout
2464
2465 \end_inset
2466 </cell>
2467 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2468 \begin_inset Text
2469
2470 \begin_layout Plain Layout
2471 export
2472 \end_layout
2473
2474 \end_inset
2475 </cell>
2476 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
2477 \begin_inset Text
2478
2479 \begin_layout Plain Layout
2480
2481 \end_layout
2482
2483 \end_inset
2484 </cell>
2485 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2486 \begin_inset Text
2487
2488 \begin_layout Plain Layout
2489 unreliable
2490 \end_layout
2491
2492 \end_inset
2493 </cell>
2494 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
2495 \begin_inset Text
2496
2497 \begin_layout Plain Layout
2498
2499 \end_layout
2500
2501 \end_inset
2502 </cell>
2503 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2504 \begin_inset Text
2505
2506 \begin_layout Plain Layout
2507 inverted
2508 \end_layout
2509
2510 \end_inset
2511 </cell>
2512 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
2513 \begin_inset Text
2514
2515 \begin_layout Plain Layout
2516
2517 \end_layout
2518
2519 \end_inset
2520 </cell>
2521 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2522 \begin_inset Text
2523
2524 \begin_layout Plain Layout
2525 suspended
2526 \end_layout
2527
2528 \end_inset
2529 </cell>
2530 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2531 \begin_inset Text
2532
2533 \begin_layout Plain Layout
2534
2535 \end_layout
2536
2537 \end_inset
2538 </cell>
2539 </row>
2540 <row>
2541 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2542 \begin_inset Text
2543
2544 \begin_layout Plain Layout
2545 Yes
2546 \end_layout
2547
2548 \end_inset
2549 </cell>
2550 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2551 \begin_inset Text
2552
2553 \begin_layout Plain Layout
2554 -
2555 \end_layout
2556
2557 \end_inset
2558 </cell>
2559 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2560 \begin_inset Text
2561
2562 \begin_layout Plain Layout
2563 -
2564 \end_layout
2565
2566 \end_inset
2567 </cell>
2568 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2569 \begin_inset Text
2570
2571 \begin_layout Plain Layout
2572 -
2573 \end_layout
2574
2575 \end_inset
2576 </cell>
2577 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2578 \begin_inset Text
2579
2580 \begin_layout Plain Layout
2581 -
2582 \end_layout
2583
2584 \end_inset
2585 </cell>
2586 <cell alignment="center" valignment="top" topline="true" usebox="none">
2587 \begin_inset Text
2588
2589 \begin_layout Plain Layout
2590 -
2591 \end_layout
2592
2593 \end_inset
2594 </cell>
2595 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2596 \begin_inset Text
2597
2598 \begin_layout Plain Layout
2599 -
2600 \end_layout
2601
2602 \end_inset
2603 </cell>
2604 <cell alignment="center" valignment="top" topline="true" usebox="none">
2605 \begin_inset Text
2606
2607 \begin_layout Plain Layout
2608
2609 \end_layout
2610
2611 \end_inset
2612 </cell>
2613 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2614 \begin_inset Text
2615
2616 \begin_layout Plain Layout
2617 -
2618 \end_layout
2619
2620 \end_inset
2621 </cell>
2622 <cell alignment="center" valignment="top" topline="true" usebox="none">
2623 \begin_inset Text
2624
2625 \begin_layout Plain Layout
2626 -
2627 \end_layout
2628
2629 \end_inset
2630 </cell>
2631 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2632 \begin_inset Text
2633
2634 \begin_layout Plain Layout
2635 -
2636 \end_layout
2637
2638 \end_inset
2639 </cell>
2640 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2641 \begin_inset Text
2642
2643 \begin_layout Plain Layout
2644 -
2645 \end_layout
2646
2647 \end_inset
2648 </cell>
2649 </row>
2650 <row>
2651 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2652 \begin_inset Text
2653
2654 \begin_layout Plain Layout
2655 No
2656 \end_layout
2657
2658 \end_inset
2659 </cell>
2660 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2661 \begin_inset Text
2662
2663 \begin_layout Plain Layout
2664 Yes
2665 \end_layout
2666
2667 \end_inset
2668 </cell>
2669 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2670 \begin_inset Text
2671
2672 \begin_layout Plain Layout
2673 -
2674 \end_layout
2675
2676 \end_inset
2677 </cell>
2678 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2679 \begin_inset Text
2680
2681 \begin_layout Plain Layout
2682 -
2683 \end_layout
2684
2685 \end_inset
2686 </cell>
2687 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2688 \begin_inset Text
2689
2690 \begin_layout Plain Layout
2691 -
2692 \end_layout
2693
2694 \end_inset
2695 </cell>
2696 <cell alignment="center" valignment="top" topline="true" usebox="none">
2697 \begin_inset Text
2698
2699 \begin_layout Plain Layout
2700 -
2701 \end_layout
2702
2703 \end_inset
2704 </cell>
2705 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2706 \begin_inset Text
2707
2708 \begin_layout Plain Layout
2709 -
2710 \end_layout
2711
2712 \end_inset
2713 </cell>
2714 <cell alignment="center" valignment="top" topline="true" usebox="none">
2715 \begin_inset Text
2716
2717 \begin_layout Plain Layout
2718 +
2719 \end_layout
2720
2721 \end_inset
2722 </cell>
2723 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2724 \begin_inset Text
2725
2726 \begin_layout Plain Layout
2727 -
2728 \end_layout
2729
2730 \end_inset
2731 </cell>
2732 <cell alignment="center" valignment="top" topline="true" usebox="none">
2733 \begin_inset Text
2734
2735 \begin_layout Plain Layout
2736 -
2737 \end_layout
2738
2739 \end_inset
2740 </cell>
2741 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2742 \begin_inset Text
2743
2744 \begin_layout Plain Layout
2745 -
2746 \end_layout
2747
2748 \end_inset
2749 </cell>
2750 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2751 \begin_inset Text
2752
2753 \begin_layout Plain Layout
2754 -
2755 \end_layout
2756
2757 \end_inset
2758 </cell>
2759 </row>
2760 <row>
2761 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
2762 \begin_inset Text
2763
2764 \begin_layout Plain Layout
2765
2766 \end_layout
2767
2768 \end_inset
2769 </cell>
2770 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2771 \begin_inset Text
2772
2773 \begin_layout Plain Layout
2774 No
2775 \end_layout
2776
2777 \end_inset
2778 </cell>
2779 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
2780 \begin_inset Text
2781
2782 \begin_layout Plain Layout
2783 Yes
2784 \end_layout
2785
2786 \end_inset
2787 </cell>
2788 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2789 \begin_inset Text
2790
2791 \begin_layout Plain Layout
2792 Yes
2793 \end_layout
2794
2795 \end_inset
2796 </cell>
2797 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2798 \begin_inset Text
2799
2800 \begin_layout Plain Layout
2801 -
2802 \end_layout
2803
2804 \end_inset
2805 </cell>
2806 <cell alignment="center" valignment="top" topline="true" usebox="none">
2807 \begin_inset Text
2808
2809 \begin_layout Plain Layout
2810 -
2811 \end_layout
2812
2813 \end_inset
2814 </cell>
2815 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2816 \begin_inset Text
2817
2818 \begin_layout Plain Layout
2819 -
2820 \end_layout
2821
2822 \end_inset
2823 </cell>
2824 <cell alignment="center" valignment="top" topline="true" usebox="none">
2825 \begin_inset Text
2826
2827 \begin_layout Plain Layout
2828 -
2829 \end_layout
2830
2831 \end_inset
2832 </cell>
2833 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2834 \begin_inset Text
2835
2836 \begin_layout Plain Layout
2837 +
2838 \end_layout
2839
2840 \end_inset
2841 </cell>
2842 <cell alignment="center" valignment="top" topline="true" usebox="none">
2843 \begin_inset Text
2844
2845 \begin_layout Plain Layout
2846 -
2847 \end_layout
2848
2849 \end_inset
2850 </cell>
2851 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2852 \begin_inset Text
2853
2854 \begin_layout Plain Layout
2855 -
2856 \end_layout
2857
2858 \end_inset
2859 </cell>
2860 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2861 \begin_inset Text
2862
2863 \begin_layout Plain Layout
2864 +
2865 \end_layout
2866
2867 \end_inset
2868 </cell>
2869 </row>
2870 <row>
2871 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2872 \begin_inset Text
2873
2874 \begin_layout Plain Layout
2875
2876 \end_layout
2877
2878 \end_inset
2879 </cell>
2880 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2881 \begin_inset Text
2882
2883 \begin_layout Plain Layout
2884
2885 \end_layout
2886
2887 \end_inset
2888 </cell>
2889 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2890 \begin_inset Text
2891
2892 \begin_layout Plain Layout
2893
2894 \end_layout
2895
2896 \end_inset
2897 </cell>
2898 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2899 \begin_inset Text
2900
2901 \begin_layout Plain Layout
2902 No
2903 \end_layout
2904
2905 \end_inset
2906 </cell>
2907 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2908 \begin_inset Text
2909
2910 \begin_layout Plain Layout
2911 -
2912 \end_layout
2913
2914 \end_inset
2915 </cell>
2916 <cell alignment="center" valignment="top" topline="true" usebox="none">
2917 \begin_inset Text
2918
2919 \begin_layout Plain Layout
2920 +
2921 \end_layout
2922
2923 \end_inset
2924 </cell>
2925 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2926 \begin_inset Text
2927
2928 \begin_layout Plain Layout
2929 -
2930 \end_layout
2931
2932 \end_inset
2933 </cell>
2934 <cell alignment="center" valignment="top" topline="true" usebox="none">
2935 \begin_inset Text
2936
2937 \begin_layout Plain Layout
2938 -
2939 \end_layout
2940
2941 \end_inset
2942 </cell>
2943 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2944 \begin_inset Text
2945
2946 \begin_layout Plain Layout
2947 +
2948 \end_layout
2949
2950 \end_inset
2951 </cell>
2952 <cell alignment="center" valignment="top" topline="true" usebox="none">
2953 \begin_inset Text
2954
2955 \begin_layout Plain Layout
2956 +
2957 \end_layout
2958
2959 \end_inset
2960 </cell>
2961 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2962 \begin_inset Text
2963
2964 \begin_layout Plain Layout
2965 -
2966 \end_layout
2967
2968 \end_inset
2969 </cell>
2970 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2971 \begin_inset Text
2972
2973 \begin_layout Plain Layout
2974 -
2975 \end_layout
2976
2977 \end_inset
2978 </cell>
2979 </row>
2980 <row>
2981 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2982 \begin_inset Text
2983
2984 \begin_layout Plain Layout
2985
2986 \end_layout
2987
2988 \end_inset
2989 </cell>
2990 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2991 \begin_inset Text
2992
2993 \begin_layout Plain Layout
2994
2995 \end_layout
2996
2997 \end_inset
2998 </cell>
2999 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3000 \begin_inset Text
3001
3002 \begin_layout Plain Layout
3003 No
3004 \end_layout
3005
3006 \end_inset
3007 </cell>
3008 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3009 \begin_inset Text
3010
3011 \begin_layout Plain Layout
3012 -
3013 \end_layout
3014
3015 \end_inset
3016 </cell>
3017 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3018 \begin_inset Text
3019
3020 \begin_layout Plain Layout
3021 -
3022 \end_layout
3023
3024 \end_inset
3025 </cell>
3026 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3027 \begin_inset Text
3028
3029 \begin_layout Plain Layout
3030 +
3031 \end_layout
3032
3033 \end_inset
3034 </cell>
3035 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3036 \begin_inset Text
3037
3038 \begin_layout Plain Layout
3039 -
3040 \end_layout
3041
3042 \end_inset
3043 </cell>
3044 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3045 \begin_inset Text
3046
3047 \begin_layout Plain Layout
3048 -
3049 \end_layout
3050
3051 \end_inset
3052 </cell>
3053 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3054 \begin_inset Text
3055
3056 \begin_layout Plain Layout
3057 -
3058 \end_layout
3059
3060 \end_inset
3061 </cell>
3062 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3063 \begin_inset Text
3064
3065 \begin_layout Plain Layout
3066 -
3067 \end_layout
3068
3069 \end_inset
3070 </cell>
3071 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3072 \begin_inset Text
3073
3074 \begin_layout Plain Layout
3075 -
3076 \end_layout
3077
3078 \end_inset
3079 </cell>
3080 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
3081 \begin_inset Text
3082
3083 \begin_layout Plain Layout
3084 -
3085 \end_layout
3086
3087 \end_inset
3088 </cell>
3089 </row>
3090 </lyxtabular>
3091
3092 \end_inset
3093
3094
3095 \end_layout
3096
3097 \begin_layout Subsubsection
3098 check_load tests
3099 \end_layout
3100
3101 \begin_layout Standard
3102 These tests check whether a .lyx file loads without any terminal messages.
3103  They correspond to the manual operations of simply opening a .lyx file on
3104  the terminal, exiting LyX once the file is loaded, and then checking whether
3105  there is any output from the terminal.
3106  These tests are useful for catching malformed .lyx files and parsing bugs.
3107  They can also be used to find a .lyx file in which an instance of something
3108  happens.
3109  To do this, compile LyX with a local patch that outputs something to the
3110  terminal when an instance is found, and then run the check_load tests to
3111  see if any fail, which would mean that the situation occurs in the LyX
3112  documentation files corresponding to the failed tests.
3113  These tests are expectedly fragile: any LyX diagnostic message, which is
3114  not necessarily an error, would cause the tests to fail.
3115  Similarly, any message output by a library (e.g.
3116  Qt) would also cause failure.
3117  There are some messages that the check_load tests are instructed to ignore,
3118  which are stored in the file 
3119 \begin_inset Flex Code
3120 status collapsed
3121
3122 \begin_layout Plain Layout
3123 development/autotests/filterCheckWarnings
3124 \end_layout
3125
3126 \end_inset
3127
3128 .
3129 \end_layout
3130
3131 \begin_layout Standard
3132 Under cmake, the tests are labeled as 'load'.
3133 \end_layout
3134
3135 \begin_layout Subsubsection
3136 lyx21 tests
3137 \end_layout
3138
3139 \begin_layout Standard
3140 These tests combine lyx2lyx tests with check_load tests.
3141  They fail if either fails.
3142 \end_layout
3143
3144 \begin_layout Subsubsection
3145 URL tests
3146 \end_layout
3147
3148 \begin_layout Standard
3149 The URL tests are enabled with the 
3150 \begin_inset Flex Code
3151 status collapsed
3152
3153 \begin_layout Plain Layout
3154 -DLYX_ENABLE_URLTESTS=ON
3155 \end_layout
3156
3157 \end_inset
3158
3159  CMake flag and are useful for finding broken links in our documentation
3160  files.
3161  If a URL test fails, to see which link in particular was reported as broken,
3162  see the output in 
3163 \begin_inset Flex Code
3164 status collapsed
3165
3166 \begin_layout Plain Layout
3167 LastTest.log
3168 \end_layout
3169
3170 \end_inset
3171
3172 .
3173  These tests are extremely fragile (e.g.
3174  a test can depend on your Internet connection) and a failed URL test should
3175  not be taken too seriously.
3176  URL tests are labeled as 
3177 \family typewriter
3178 'url'.
3179 \end_layout
3180
3181 \begin_layout Paragraph
3182 Running URL tests
3183 \end_layout
3184
3185 \begin_layout Standard
3186 cmake is required to run the \SpecialChar LyX
3187  tests, running them is not implemented for
3188  autotools.
3189 \end_layout
3190
3191 \begin_layout Standard
3192 The appropriate commands are:
3193 \end_layout
3194
3195 \begin_layout Itemize
3196
3197 \family typewriter
3198 ctest -L url
3199 \family default
3200
3201 \begin_inset Newline newline
3202 \end_inset
3203
3204 runs all tests with label 
3205 \family typewriter
3206 'url'
3207 \end_layout
3208
3209 \begin_layout Itemize
3210
3211 \family typewriter
3212 ctest -R 'check_.*urls'
3213 \family default
3214
3215 \begin_inset Newline newline
3216 \end_inset
3217
3218 runs the tests 'check_accessible_urls'
3219 \end_layout
3220
3221 \begin_layout Standard
3222 Associated test results can be examined in ctest-log directory in files
3223  of the form 'LastFailed.*URLS.log'
3224 \end_layout
3225
3226 \begin_layout Subsubsection
3227 Test labels
3228 \end_layout
3229
3230 \begin_layout Standard
3231 ctest label commands:
3232 \end_layout
3233
3234 \begin_layout Description
3235 \SpecialChar nobreakdash
3236 \SpecialChar nobreakdash
3237 print-labels shows all assigned labels
3238 \end_layout
3239
3240 \begin_layout Description
3241 \SpecialChar nobreakdash
3242 L
3243 \begin_inset space ~
3244 \end_inset
3245
3246 labelname executes all tests to which this label is assigned to.
3247  A test may have more that one label.
3248 \end_layout
3249
3250 \begin_layout Description
3251 \SpecialChar nobreakdash
3252 j
3253 \begin_inset space ~
3254 \end_inset
3255
3256 number executes tests in parallel using 'number' simultaneously processes.
3257  Some tests are marked as 'sequencial', for them this parameter has no effect.
3258 \end_layout
3259
3260 \begin_layout Section
3261 Development policies
3262 \end_layout
3263
3264 \begin_layout Standard
3265 This chapter lists some guidelines that should be followed.
3266  This list is not complete, and many guidelines are in separate chapters,
3267  such as 
3268 \begin_inset Quotes eld
3269 \end_inset
3270
3271 When is an update of the .lyx file format number needed?
3272 \begin_inset Quotes erd
3273 \end_inset
3274
3275  in Section 
3276 \begin_inset CommandInset ref
3277 LatexCommand ref
3278 reference "sec:When-is-an"
3279
3280 \end_inset
3281
3282 .
3283 \end_layout
3284
3285 \begin_layout Subsection
3286 When to set a fixed milestone?
3287 \end_layout
3288
3289 \begin_layout Standard
3290 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
3291  holds:
3292 \end_layout
3293
3294 \begin_layout Enumerate
3295 Somebody is actively working on a fix.
3296 \end_layout
3297
3298 \begin_layout Enumerate
3299 The bug is so severe that it would block the release if it is not fixed.
3300 \end_layout
3301
3302 \begin_layout Standard
3303 If a bug is important, but nobody is working on it, and it is no showstopper,
3304  use a milestone like 2.1.x or 2.2.x.
3305  For all other bugs, do not set a milestone at all.
3306 \end_layout
3307
3308 \begin_layout Subsection
3309 Can we add rc entries in stable branch?
3310 \end_layout
3311
3312 \begin_layout Standard
3313 No.
3314  We are supposed to increase the prefs2prefs version number with such things.
3315 \end_layout
3316
3317 \begin_layout Section
3318 Documentation policies
3319 \end_layout
3320
3321 \begin_layout Standard
3322 The main documentation consists of these files:
3323 \end_layout
3324
3325 \begin_layout Description
3326 splash.lyx it is the first file you see after an installation.
3327  We assume that a new user sees this.
3328  It is therefore designed to be as simple as possible.
3329  Therefore please don't add any new formatting, only fix typos etc.
3330  Splash.lyx is up to date for \SpecialChar LyX
3331  2.1.x, currently maintained by Uwe Stöhr.
3332 \end_layout
3333
3334 \begin_layout Description
3335 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
3336 .
3337  It therefore uses a limited set of formatting.
3338  For example a standard document class.
3339  Since new users will first learn about the formatting possibilities of
3340  \SpecialChar LyX
3341  please keep this file that simple.
3342  Intro.lyx is up to date for \SpecialChar LyX
3343  2.1.x, currently maintained by Uwe Stöhr.
3344 \end_layout
3345
3346 \begin_layout Description
3347 Tutorial.lyx our tutorial.
3348  It must be always up to date.
3349  Normally there is nothing to add since we don't want to overwhelm new users
3350  with too much details.
3351  The will learn these details while using \SpecialChar LyX
3352  and we have special manuals.
3353  Tutorial.lyx is up to date for \SpecialChar LyX
3354  2.1.x, currently maintained by Uwe Stöhr.
3355 \end_layout
3356
3357 \begin_layout Description
3358 UserGuide.lyx our main user guide.
3359  It covers a mixture of basic and detailed information.
3360  Some information is also in the Math and EmbeddedObjects manual so that
3361  the UserGuide refers to these files.
3362  UserGuide.lyx is up to date for \SpecialChar LyX
3363  2.1.x, currently maintained by Uwe Stöhr.
3364 \end_layout
3365
3366 \begin_layout Description
3367 EmbeddedObjects.lyx a special manual to explain things like tables floats
3368  boxes etc.
3369  in all detail.
3370  EmbeddedObjects.lyx is up to date for \SpecialChar LyX
3371  2.1.x, currently maintained by Uwe
3372  Stöhr.
3373 \end_layout
3374
3375 \begin_layout Description
3376 Math.lyx a special manual to explain everything regarding math in all detail.
3377  Math.lyx is up to date for \SpecialChar LyX
3378  2.1.x, currently maintained by Uwe Stöhr.
3379 \end_layout
3380
3381 \begin_layout Description
3382 Additional.lyx this manual covers information that would be too much detail
3383  for the UserGuide or would make the UserGuide uncompilable or only compilable
3384  when installing a lot of special \SpecialChar LaTeX
3385 -packages.
3386  What should be in the UserGuide or better in Additional is a matter of
3387  taste.
3388  it is up to you to decide that.
3389  Additional.lyx is not completely up to date for \SpecialChar LyX
3390  2.1.x.
3391  Only chapter
3392 \begin_inset space ~
3393 \end_inset
3394
3395 8 is up to date and currently maintained by Uwe Stöhr.
3396  It certainly needs a rewrite and update.
3397  For example many info in chapter
3398 \begin_inset space ~
3399 \end_inset
3400
3401 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
3402  manual.
3403 \end_layout
3404
3405 \begin_layout Description
3406 Customization.lyx this manual covers information how to customize \SpecialChar LyX
3407  for certain
3408  output formats, operating systems, languages etc.
3409  It is currently completely out of date and needs a major rewrite and update.
3410  If you do this please assure that your information are given for all OSes
3411  and \SpecialChar LaTeX
3412  distributions (meaning be as objective as possible).
3413 \end_layout
3414
3415 \begin_layout Standard
3416 There are only 4
3417 \begin_inset space ~
3418 \end_inset
3419
3420 rules in editing the docs:
3421 \end_layout
3422
3423 \begin_layout Enumerate
3424 If you are not the maintainer of a doc file or a chapter/section, you MUST
3425  use change tracking so that the maintainer could review your changes
3426 \end_layout
3427
3428 \begin_layout Enumerate
3429 Respect the formatting of the document.
3430  The different files use different formatting styles.
3431  That is OK and has historic reasons nobody fully know ;-).
3432  But it is important to be consistent within one file.
3433 \end_layout
3434
3435 \begin_layout Enumerate
3436 All changes you make to a file in one language MUST also go the file in
3437  the other actively maintained languages.
3438  Normally the maintainer does this for you, if you are the maintainer, you
3439  must do this by copying or changing the changed or added text to the other
3440  files so that the translators sees the blue underlined text and know what
3441  they have to translate and what was changed.
3442 \end_layout
3443
3444 \begin_layout Enumerate
3445 You MUST assure that the document is compilable as 
3446 \begin_inset Quotes eld
3447 \end_inset
3448
3449 PDF (pdflatex)
3450 \begin_inset Quotes erd
3451 \end_inset
3452
3453  after your changes.
3454 \end_layout
3455
3456 \end_body
3457 \end_document