]> git.lyx.org Git - lyx.git/blob - lib/doc/Development.lyx
ctest autotest documentation update
[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 \begin_inset CommandInset label
1466 LatexCommand label
1467 name "par:ctest-options"
1468
1469 \end_inset
1470
1471 Running the tests
1472 \end_layout
1473
1474 \begin_layout Standard
1475 To run all tests, in the build directory simply run the command 
1476 \begin_inset Flex Code
1477 status collapsed
1478
1479 \begin_layout Plain Layout
1480 ctest
1481 \end_layout
1482
1483 \end_inset
1484
1485 .
1486  
1487 \end_layout
1488
1489 \begin_layout Standard
1490 To run only some of the tests, use command line options:
1491 \end_layout
1492
1493 \begin_layout Labeling
1494 \labelwidthstring -R
1495 \begin_inset Flex Code
1496 status collapsed
1497
1498 \begin_layout Plain Layout
1499 -R <pattern>
1500 \end_layout
1501
1502 \end_inset
1503
1504  Run only the tests whose names match the given regular expression.
1505 \end_layout
1506
1507 \begin_layout Labeling
1508 \labelwidthstring -R
1509 \begin_inset Flex Code
1510 status collapsed
1511
1512 \begin_layout Plain Layout
1513 -L <pattern>
1514 \end_layout
1515
1516 \end_inset
1517
1518  Run only the tests whose labels match the given regular expression.
1519  A test may have more that one label.
1520  
1521 \end_layout
1522
1523 \begin_deeper
1524 \begin_layout Standard
1525 For example, to run only the export tests, you can use 
1526 \begin_inset Flex Code
1527 status collapsed
1528
1529 \begin_layout Plain Layout
1530 ctest -L export
1531 \end_layout
1532
1533 \end_inset
1534
1535 .
1536 \end_layout
1537
1538 \end_deeper
1539 \begin_layout Labeling
1540 \labelwidthstring -R
1541 \begin_inset Flex Code
1542 status collapsed
1543
1544 \begin_layout Plain Layout
1545 -E <pattern>
1546 \end_layout
1547
1548 \end_inset
1549
1550  Exclude the tests whose names match the given regular expression.
1551 \end_layout
1552
1553 \begin_layout Labeling
1554 \labelwidthstring -R
1555 \begin_inset Flex Code
1556 status collapsed
1557
1558 \begin_layout Plain Layout
1559 -LE <pattern>
1560 \end_layout
1561
1562 \end_inset
1563
1564  Exclude the tests whose labels match the given regular expression.
1565  Cannot be combined with 
1566 \begin_inset Flex Code
1567 status collapsed
1568
1569 \begin_layout Plain Layout
1570 -L
1571 \end_layout
1572
1573 \end_inset
1574
1575 .
1576 \end_layout
1577
1578 \begin_layout Standard
1579 The following options help to find good selection patterns:
1580 \end_layout
1581
1582 \begin_layout Labeling
1583 \labelwidthstring -R
1584 \begin_inset Flex Code
1585 status collapsed
1586
1587 \begin_layout Plain Layout
1588 -N
1589 \end_layout
1590
1591 \end_inset
1592
1593  List the tests that would be run but not actually run them.
1594  
1595 \end_layout
1596
1597 \begin_deeper
1598 \begin_layout Standard
1599 Useful in conjunction with the -R, -L, -E and -LE options, e.g., if you want
1600  to know how many tests there are or whether your 
1601 \begin_inset Flex Code
1602 status collapsed
1603
1604 \begin_layout Plain Layout
1605 <pattern>
1606 \end_layout
1607
1608 \end_inset
1609
1610  regular expression did what you expected.
1611 \end_layout
1612
1613 \end_deeper
1614 \begin_layout Labeling
1615 \labelwidthstring -R
1616 \begin_inset Flex Code
1617 status collapsed
1618
1619 \begin_layout Plain Layout
1620 \SpecialChar nobreakdash
1621 \SpecialChar nobreakdash
1622 print-labels
1623 \end_layout
1624
1625 \end_inset
1626
1627  print the list of all labels associated with the test set.
1628  Can also be combined with -R, -L, -E, ...
1629  
1630 \end_layout
1631
1632 \begin_layout Standard
1633 Other useful options are:
1634 \end_layout
1635
1636 \begin_layout Labeling
1637 \labelwidthstring -R
1638 \begin_inset Flex Code
1639 status collapsed
1640
1641 \begin_layout Plain Layout
1642 -j <jobs>
1643 \end_layout
1644
1645 \end_inset
1646
1647  Run the tests in parallel using the given number of jobs.
1648 \end_layout
1649
1650 \begin_deeper
1651 \begin_layout Standard
1652 We are still working on getting the tests to run in parallel.
1653  However, when running the tests in parallel, sometimes tests fail that
1654  pass when run sequentially.
1655  A reasonable approach is to first run the tests in parallel and then run
1656  the failed tests sequentially.
1657  
1658 \end_layout
1659
1660 \begin_layout Standard
1661 For example, to run 8 jobs at a time:
1662 \end_layout
1663
1664 \begin_layout Standard
1665 \begin_inset Flex Code
1666 status collapsed
1667
1668 \begin_layout Plain Layout
1669 ctest -j8
1670 \end_layout
1671
1672 \end_inset
1673
1674
1675 \end_layout
1676
1677 \begin_layout Standard
1678 \begin_inset Flex Code
1679 status collapsed
1680
1681 \begin_layout Plain Layout
1682 ctest \SpecialChar nobreakdash
1683 \SpecialChar nobreakdash
1684 rerun-failed
1685 \end_layout
1686
1687 \end_inset
1688
1689
1690 \end_layout
1691
1692 \begin_layout Standard
1693 \noindent
1694 Note that some tests cannot be run in parallel.
1695  These tests are marked in the code with the 
1696 \begin_inset Flex Code
1697 status collapsed
1698
1699 \begin_layout Plain Layout
1700 \noindent
1701 RUN_SERIAL ON
1702 \end_layout
1703
1704 \end_inset
1705
1706  CMake property.
1707 \end_layout
1708
1709 \end_deeper
1710 \begin_layout Labeling
1711 \labelwidthstring -R
1712 \begin_inset Flex Code
1713 status collapsed
1714
1715 \begin_layout Plain Layout
1716 \SpecialChar nobreakdash
1717 \SpecialChar nobreakdash
1718 timeout <seconds>
1719 \end_layout
1720
1721 \end_inset
1722
1723  Set a global timeout on all tests that do not already have a timeout set
1724  on them.
1725 \end_layout
1726
1727 \begin_deeper
1728 \begin_layout Standard
1729 There have been bugs in LyX and in \SpecialChar LaTeX
1730  which cause compilation to hang, and
1731  without a timeout a test might never stop (in one case there was even a
1732  memory leak).
1733  If a test times out, the 
1734 \begin_inset Flex Code
1735 status collapsed
1736
1737 \begin_layout Plain Layout
1738 ctest
1739 \end_layout
1740
1741 \end_inset
1742
1743  command exits with error, but you can distinguish between a timed out test
1744  and a failed test in the output reported at the end of the 
1745 \begin_inset Flex Code
1746 status collapsed
1747
1748 \begin_layout Plain Layout
1749 ctest
1750 \end_layout
1751
1752 \end_inset
1753
1754  command.
1755 \end_layout
1756
1757 \end_deeper
1758 \begin_layout Standard
1759 See the manual (
1760 \begin_inset Flex Code
1761 status collapsed
1762
1763 \begin_layout Plain Layout
1764 man ctest
1765 \end_layout
1766
1767 \end_inset
1768
1769 ) the full list of command line options.
1770 \end_layout
1771
1772 \begin_layout Paragraph
1773 \begin_inset CommandInset label
1774 LatexCommand label
1775 name "subsec:Interpreting-export-tests"
1776
1777 \end_inset
1778
1779 Interpreting the export test results
1780 \end_layout
1781
1782 \begin_layout Standard
1783 A test can fail for several reasons, not all of them bad.
1784 \end_layout
1785
1786 \begin_layout Enumerate
1787 The .lyx file could have been added recently and some formats are not expected
1788  to work well.
1789 \end_layout
1790
1791 \begin_layout Enumerate
1792 A dependency is not met (e.g.
1793  the \SpecialChar LaTeX
1794  class file).
1795  One hint that this is the case is that the corresponding 
1796 \begin_inset Flex Code
1797 status collapsed
1798
1799 \begin_layout Plain Layout
1800 check_load
1801 \end_layout
1802
1803 \end_inset
1804
1805  test will likely also fail.
1806 \end_layout
1807
1808 \begin_layout Enumerate
1809 An inverted test fails to fail (i.e.
1810  export that previously failed now works).
1811 \end_layout
1812
1813 \begin_layout Enumerate
1814 An external dependency was updated (e.g.
1815  \SpecialChar TeX
1816  Live).
1817 \end_layout
1818
1819 \begin_layout Enumerate
1820 A recent code change introduced a bug.
1821 \end_layout
1822
1823 \begin_layout Enumerate
1824 \begin_inset CommandInset label
1825 LatexCommand label
1826 name "enu:exposed"
1827
1828 \end_inset
1829
1830 A change in a document exposed a previously unknown bug or an incompatibility
1831  with an export format (e.g.
1832  Lua\SpecialChar LaTeX
1833 ).
1834 \end_layout
1835
1836 \begin_layout Standard
1837 Because the .lyx files are exported in several formats, it is not surprising
1838  that many of the exports fail.
1839  This expectation of failure is addressed by 
1840 \begin_inset Quotes eld
1841 \end_inset
1842
1843 inverting
1844 \begin_inset Quotes erd
1845 \end_inset
1846
1847  the tests, that is, by marking the test as 
1848 \begin_inset Quotes eld
1849 \end_inset
1850
1851 passing
1852 \begin_inset Quotes erd
1853 \end_inset
1854
1855  if the export exits with error and as 
1856 \begin_inset Quotes eld
1857 \end_inset
1858
1859 failing
1860 \begin_inset Quotes erd
1861 \end_inset
1862
1863  if the export succeeds
1864 \emph on
1865 .
1866
1867 \emph default
1868  It follows that these expected failures will not show up as failed tests
1869  in the test results and thus will not pollute the 
1870 \begin_inset Quotes eld
1871 \end_inset
1872
1873 good
1874 \begin_inset Quotes erd
1875 \end_inset
1876
1877  tests.
1878  If the export actually succeeds, then the test will fail.
1879  The purpose of this failure is to get your attention—something has changed,
1880  possibly for the better.
1881 \end_layout
1882
1883 \begin_layout Standard
1884 We try to document why a test is inverted or ignored.
1885  See the comment (prefixed with 
1886 \begin_inset Flex Code
1887 status collapsed
1888
1889 \begin_layout Plain Layout
1890 #
1891 \end_layout
1892
1893 \end_inset
1894
1895 ) above the block in which the test is listed as inverted or ignored in
1896  the files 
1897 \begin_inset Flex Code
1898 status collapsed
1899
1900 \begin_layout Plain Layout
1901 development/autotests/suspiciousTests
1902 \end_layout
1903
1904 \end_inset
1905
1906  and 
1907 \begin_inset Flex Code
1908 status collapsed
1909
1910 \begin_layout Plain Layout
1911 development/autotests/ignoredTests
1912 \end_layout
1913
1914 \end_inset
1915
1916 .
1917  It is possible that an export goes from succeeding to failing just because
1918  the document was changed and the document was never expected to work with
1919  a certain export format in the first case.
1920  Once this is confirmed to be the situation, the test can be inverted.
1921 \end_layout
1922
1923 \begin_layout Standard
1924 A good question is why do we enable the tests for non-default formats? The
1925  answer is that if a non-default route is broken it is often because a bug
1926  was introduced in LyX and not because a document-specific change was made
1927  that is not supported by the route.
1928  In other words, there is a high signal/noise ratio in the export tests
1929  for some non-default formats.
1930  
1931 \end_layout
1932
1933 \begin_layout Standard
1934 When a test or several tests fail, consider checking the files in the 
1935 \begin_inset Flex Code
1936 status collapsed
1937
1938 \begin_layout Plain Layout
1939 Testing/Temporary/
1940 \end_layout
1941
1942 \end_inset
1943
1944  subdirectory of your build directory.
1945  In this subdirectory are three files: the file 
1946 \begin_inset Flex Code
1947 status collapsed
1948
1949 \begin_layout Plain Layout
1950 LastTestsFailed.log
1951 \end_layout
1952
1953 \end_inset
1954
1955  simply lists the tests that failed on your last 
1956 \begin_inset Flex Code
1957 status collapsed
1958
1959 \begin_layout Plain Layout
1960 ctest
1961 \end_layout
1962
1963 \end_inset
1964
1965  command; the 
1966 \begin_inset Flex Code
1967 status collapsed
1968
1969 \begin_layout Plain Layout
1970 LastTest.log
1971 \end_layout
1972
1973 \end_inset
1974
1975  file contains the output from the tests (and often has details explaining
1976  why a test failed); and the 
1977 \begin_inset Flex Code
1978 status collapsed
1979
1980 \begin_layout Plain Layout
1981 CTestCostData.txt
1982 \end_layout
1983
1984 \end_inset
1985
1986  file lists the times that it took to run the tests.
1987 \end_layout
1988
1989 \begin_layout Paragraph
1990 What action should you take if a test fails?
1991 \end_layout
1992
1993 \begin_layout Standard
1994 \paragraph_spacing single
1995 It is always good to check manually why something fails and if it passes
1996  if the PDF output is good.
1997 \end_layout
1998
1999 \begin_layout Itemize
2000 Generally, if a change breaks compilation for the target format (for the
2001  manuals pdf2) without solving some important other issue, 
2002 \emph on
2003 fix or revert the commit
2004 \emph default
2005  that led to failure.
2006 \end_layout
2007
2008 \begin_layout Itemize
2009 If it is not possible to (immediately) fix the failure but there are reasons
2010  not to revert the commit (e.g.
2011  it fixes another more important issue), 
2012 \emph on
2013 invert
2014 \emph default
2015  the failing test case (see 
2016 \begin_inset CommandInset ref
2017 LatexCommand ref
2018 reference "par:Inverted-tests"
2019
2020 \end_inset
2021
2022 ).
2023 \end_layout
2024
2025 \begin_layout Itemize
2026 If an 
2027 \emph on
2028 inverted
2029 \emph default
2030  test case fails because the export now works, 
2031 \emph on
2032 uninvert
2033 \emph default
2034  the test by removing the labeling pattern from 
2035 \begin_inset Quotes eld
2036 \end_inset
2037
2038 suspiciousTests
2039 \begin_inset Quotes erd
2040 \end_inset
2041
2042 ) (see 
2043 \begin_inset CommandInset ref
2044 LatexCommand ref
2045 reference "par:Inverted-tests"
2046
2047 \end_inset
2048
2049 ).
2050 \end_layout
2051
2052 \begin_layout Itemize
2053 If the export did not fail previously but led to wrong output (PDF, say),
2054  it is in fact an improvement when the test now fails, label it as 
2055 \begin_inset Quotes eld
2056 \end_inset
2057
2058 unreliable:wrong:output
2059 \begin_inset Quotes erd
2060 \end_inset
2061
2062  (
2063 \begin_inset CommandInset ref
2064 LatexCommand ref
2065 reference "par:Unreliable-tests"
2066
2067 \end_inset
2068
2069 ).
2070 \end_layout
2071
2072 \begin_layout Paragraph
2073 \begin_inset CommandInset label
2074 LatexCommand label
2075 name "par:Inverted-tests"
2076
2077 \end_inset
2078
2079 Inverted tests
2080 \end_layout
2081
2082 \begin_layout Standard
2083 Test cases whose name matches a pattern in the file 
2084 \begin_inset Flex Code
2085 status collapsed
2086
2087 \begin_layout Plain Layout
2088 development/autotests/suspiciousTests
2089 \end_layout
2090
2091 \end_inset
2092
2093  get the label 
2094 \emph on
2095 inverted
2096 \emph default
2097 .
2098  They get also the test property 
2099 \begin_inset Flex Code
2100 status collapsed
2101
2102 \begin_layout Plain Layout
2103 WILL_FAIL
2104 \end_layout
2105
2106 \end_inset
2107
2108 , i.e.
2109  they are reported as failing if the export works without error 
2110 \begin_inset Flex URL
2111 status collapsed
2112
2113 \begin_layout Plain Layout
2114
2115 https://cmake.org/cmake/help/v3.0/command/set_tests_properties.html
2116 \end_layout
2117
2118 \end_inset
2119
2120 .
2121 \end_layout
2122
2123 \begin_layout Standard
2124 Add failing cases to this file, if they cannot be solved 
2125 \begin_inset Quotes eld
2126 \end_inset
2127
2128 immediately
2129 \begin_inset Quotes erd
2130 \end_inset
2131
2132  but it is expected that the export will work in a foreseeable future, e.g.
2133  low priority issues like failures to export to a non-target format (for
2134  the manuals everything except pdf2).
2135 \end_layout
2136
2137 \begin_layout Standard
2138 The following sublabels are currently present in 
2139 \begin_inset Flex Code
2140 status collapsed
2141
2142 \begin_layout Plain Layout
2143 suspiciousTests
2144 \end_layout
2145
2146 \end_inset
2147
2148 :
2149 \end_layout
2150
2151 \begin_layout Description
2152 todo test failures that require attention:
2153 \end_layout
2154
2155 \begin_deeper
2156 \begin_layout Itemize
2157 minor issues to explore and properly sort later, 
2158 \end_layout
2159
2160 \begin_layout Itemize
2161 easyfix issues,
2162 \end_layout
2163
2164 \begin_layout Itemize
2165 LyX bugs to report at trac (move pattern to section "lyxbugs" once done).
2166 \end_layout
2167
2168 \end_deeper
2169 \begin_layout Description
2170 lyxbugs LyX bugs with a Trac number.
2171 \end_layout
2172
2173 \begin_layout Description
2174 ert Export failures due to "raw" LaTeX use in ERT or preamble code.
2175 \end_layout
2176
2177 \begin_deeper
2178 \begin_layout Standard
2179 "Wontfix" if demonstrating correct use and OK in the default output format.
2180 \end_layout
2181
2182 \end_deeper
2183 \begin_layout Description
2184 texissues Export fails due to LaTeX limitations like non-ASCII characters
2185  in verbatim or listings, incompatible packages, ...
2186 \end_layout
2187
2188 \begin_deeper
2189 \begin_layout Standard
2190 "Wontfix" if documents demonstrate correct use in the default output format:
2191 \end_layout
2192
2193 \begin_layout Itemize
2194 If the source can be made more robust without becoming "hackish", fix the
2195  source,
2196 \end_layout
2197
2198 \begin_layout Itemize
2199 if LyX could be enhanced to care for a permanent TeX limitation, file a
2200  ticket at trac and add a pattern under lyxbugs,
2201 \end_layout
2202
2203 \begin_layout Itemize
2204 otherwise, add a pattern here.
2205 \end_layout
2206
2207 \end_deeper
2208 \begin_layout Description
2209 attic Documents in the attic.
2210  (Kept for reference and format conversion test.)
2211 \end_layout
2212
2213 \begin_layout Subparagraph
2214 suspended 
2215 \end_layout
2216
2217 \begin_layout Standard
2218 Test cases whose name additionally matches a pattern in the file 
2219 \begin_inset Flex Code
2220 status collapsed
2221
2222 \begin_layout Plain Layout
2223 development/autotests/suspendedTests
2224 \end_layout
2225
2226 \end_inset
2227
2228  get the label 
2229 \emph on
2230 suspended 
2231 \emph default
2232 (instead of 
2233 \emph on
2234 export 
2235 \emph default
2236 and
2237 \emph on
2238  inverted
2239 \emph default
2240 ).
2241  This means they are not executed using 
2242 \begin_inset Flex Code
2243 status collapsed
2244
2245 \begin_layout Plain Layout
2246 ctest -L export
2247 \end_layout
2248
2249 \end_inset
2250
2251  or 
2252 \begin_inset Flex Code
2253 status collapsed
2254
2255 \begin_layout Plain Layout
2256 ctest -L inverted
2257 \end_layout
2258
2259 \end_inset
2260
2261 .
2262  However, they also get the test property 
2263 \begin_inset Flex Code
2264 status collapsed
2265
2266 \begin_layout Plain Layout
2267 WILL_FAIL
2268 \end_layout
2269
2270 \end_inset
2271
2272 , i.e.
2273  they are reported as failing if the export works without error.
2274  From time to time they still have to be checked using 
2275 \begin_inset Flex Code
2276 status collapsed
2277
2278 \begin_layout Plain Layout
2279 ctest -L suspended
2280 \end_layout
2281
2282 \end_inset
2283
2284 .
2285 \end_layout
2286
2287 \begin_layout Standard
2288 These tests are suspended, because the export fails for known reasons which
2289  cannot ATM be resolved.
2290  But it is expected the reason might disappear in the future.
2291  Be it new TL or better handling in \SpecialChar LyX
2292 .
2293 \end_layout
2294
2295 \begin_layout Standard
2296 For ctest commands without the 
2297 \begin_inset Flex Code
2298 status collapsed
2299
2300 \begin_layout Plain Layout
2301 -L
2302 \end_layout
2303
2304 \end_inset
2305
2306  parameter nothing changes.
2307  Suspended or not, tests will be executed depending only on the selectiong
2308  regular expression given to the ctest command (see 
2309 \begin_inset CommandInset ref
2310 LatexCommand ref
2311 reference "par:ctest-options"
2312
2313 \end_inset
2314
2315 ).
2316 \end_layout
2317
2318 \begin_layout Paragraph
2319 \begin_inset CommandInset label
2320 LatexCommand label
2321 name "par:Unreliable-tests"
2322
2323 \end_inset
2324
2325 Unreliable tests
2326 \end_layout
2327
2328 \begin_layout Standard
2329 Test cases whose name matches a pattern in the file 
2330 \begin_inset Flex Code
2331 status collapsed
2332
2333 \begin_layout Plain Layout
2334 development/autotests/unreliableTests
2335 \end_layout
2336
2337 \end_inset
2338
2339  get the label 
2340 \emph on
2341 unreliable
2342 \emph default
2343 .
2344 \end_layout
2345
2346 \begin_layout Standard
2347 These tests are not executed using 
2348 \begin_inset Flex Code
2349 status collapsed
2350
2351 \begin_layout Plain Layout
2352 ctest -L export
2353 \end_layout
2354
2355 \end_inset
2356
2357  or 
2358 \begin_inset Flex Code
2359 status collapsed
2360
2361 \begin_layout Plain Layout
2362 ctest -L inverted
2363 \end_layout
2364
2365 \end_inset
2366
2367 .
2368  
2369 \end_layout
2370
2371 \begin_layout Standard
2372 They pass or fail for various reasons not related to LyX (nonstandard, erratic)
2373  or pass but should rather fail (wrong output).
2374  
2375 \begin_inset Note Note
2376 status collapsed
2377
2378 \begin_layout Plain Layout
2379 *invalid* tests (wrong output) are not *unreliable*.
2380  # Use "unfit" or "unapplicable" as better label and name of pattern file?
2381  
2382 \end_layout
2383
2384 \end_inset
2385
2386
2387 \end_layout
2388
2389 \begin_layout Description
2390 nonstandard Documents with additional requirements, e.g.
2391  a class or package file not in TeXLive.
2392  
2393 \begin_inset Note Note
2394 status open
2395
2396 \begin_layout Plain Layout
2397 TODO: rename to "extra"?
2398 \end_layout
2399
2400 \end_inset
2401
2402
2403 \end_layout
2404
2405 \begin_deeper
2406 \begin_layout Standard
2407 These tests are labeled as 
2408 \family typewriter
2409 'nonstandard'.
2410 \end_layout
2411
2412 \end_deeper
2413 \begin_layout Description
2414 erratic Tests depending on local configuration, OS, TeX distribution, package
2415  versions, or the phase of the moon.
2416  
2417 \begin_inset Note Note
2418 status open
2419
2420 \begin_layout Plain Layout
2421 TODO: use 
2422 \emph on
2423 erratic
2424 \emph default
2425  only for the phase-of-moon dependency?
2426 \end_layout
2427
2428 \end_inset
2429
2430
2431 \end_layout
2432
2433 \begin_deeper
2434 \begin_layout Standard
2435 These tests are labeled as 
2436 \family typewriter
2437 'erratic'.
2438 \end_layout
2439
2440 \end_deeper
2441 \begin_layout Description
2442 wrong
2443 \begin_inset space ~
2444 \end_inset
2445
2446 output Export does not fail but the resulting document has errors.
2447 \end_layout
2448
2449 \begin_deeper
2450 \begin_layout Standard
2451 \paragraph_spacing single
2452 \begin_inset Note Note
2453 status open
2454
2455 \begin_layout Plain Layout
2456 \paragraph_spacing single
2457 These tests are actually not 
2458 \emph on
2459 unreliable
2460 \emph default
2461  but 
2462 \emph on
2463 invalid
2464 \emph default
2465  (not measuring what they should measure).
2466 \end_layout
2467
2468 \end_inset
2469
2470
2471 \end_layout
2472
2473 \end_deeper
2474 \begin_layout Paragraph
2475 Export test filtering
2476 \end_layout
2477
2478 \begin_layout Standard
2479 The assignment of a label to a test is controlled by a set of files with
2480  regular expressions that are matched against the test names.
2481 \end_layout
2482
2483 \begin_layout Description
2484 ignoredTests (small file)
2485 \begin_inset Newline newline
2486 \end_inset
2487
2488 Tests selected here are withdrawn in the configuration step (cf.
2489  
2490 \begin_inset CommandInset ref
2491 LatexCommand ref
2492 reference "par:Configuring-ctests"
2493
2494 \end_inset
2495
2496 ).
2497 \end_layout
2498
2499 \begin_deeper
2500 \begin_layout Labeling
2501 \labelwidthstring 00.00.0000
2502 Input Test of any export combination
2503 \end_layout
2504
2505 \begin_layout Labeling
2506 \labelwidthstring 00.00.0000
2507 Output Stop if tests not selected here
2508 \end_layout
2509
2510 \end_deeper
2511 \begin_layout Description
2512 unreliableTests: Tests selected either pass or fail, but that is dependent
2513  on the system where the test is run.
2514  Selected tests gain the label 'unreliable'.
2515 \end_layout
2516
2517 \begin_deeper
2518 \begin_layout Labeling
2519 \labelwidthstring 00.00.0000
2520 Input Each test which passed 'ignoredTests'
2521 \end_layout
2522
2523 \begin_layout Labeling
2524 \labelwidthstring 00.00.0000
2525 Output Stop if test selected, gain label 'unreliable'.
2526 \end_layout
2527
2528 \end_deeper
2529 \begin_layout Description
2530 suspiciousTests 
2531 \begin_inset space \space{}
2532 \end_inset
2533
2534
2535 \end_layout
2536
2537 \begin_deeper
2538 \begin_layout Labeling
2539 \labelwidthstring 00.00.0000
2540 Input Each test which passed 'unreliableTests'
2541 \end_layout
2542
2543 \begin_layout Labeling
2544 \labelwidthstring 00.00.0000
2545 Output Stop if not selected.
2546 \end_layout
2547
2548 \begin_layout Standard
2549 The following file is meant as subselections of 'suspiciousTests'.
2550  If neither subselection applies, test gains labels 'export' and 'inverted'
2551 \end_layout
2552
2553 \begin_layout Description
2554 suspendedTests Tests selected here gain the label 'suspended' but _not_
2555  'export' or 'inverted', although in ctest they remain inverted.
2556  ('ctest' knows only 'inverted' or not, labels are used only for test selection)
2557 \end_layout
2558
2559 \begin_deeper
2560 \begin_layout Labeling
2561 \labelwidthstring 00.00.0000
2562 Input Each test selected by 'suspiciousTests' 
2563 \end_layout
2564
2565 \begin_layout Labeling
2566 \labelwidthstring 00.00.0000
2567 Output Selected test gains label 'suspended'.
2568  
2569 \end_layout
2570
2571 \end_deeper
2572 \end_deeper
2573 \begin_layout Standard
2574 The following table may clarify label assignement
2575 \end_layout
2576
2577 \begin_layout Standard
2578 \begin_inset Tabular
2579 <lyxtabular version="3" rows="7" columns="12">
2580 <features tabularvalignment="middle">
2581 <column alignment="left" valignment="top" width="0pt">
2582 <column alignment="left" valignment="top" width="0pt">
2583 <column alignment="left" valignment="top" width="0pt">
2584 <column alignment="left" valignment="top" width="0pt">
2585 <column alignment="center" valignment="top">
2586 <column alignment="center" valignment="top">
2587 <column alignment="center" valignment="top">
2588 <column alignment="center" valignment="top">
2589 <column alignment="center" valignment="top">
2590 <column alignment="center" valignment="top">
2591 <column alignment="center" valignment="top">
2592 <column alignment="center" valignment="top">
2593 <row>
2594 <cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2595 \begin_inset Text
2596
2597 \begin_layout Plain Layout
2598 Test found in file:
2599 \end_layout
2600
2601 \end_inset
2602 </cell>
2603 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2604 \begin_inset Text
2605
2606 \begin_layout Plain Layout
2607
2608 \end_layout
2609
2610 \end_inset
2611 </cell>
2612 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2613 \begin_inset Text
2614
2615 \begin_layout Plain Layout
2616
2617 \end_layout
2618
2619 \end_inset
2620 </cell>
2621 <cell multicolumn="2" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
2622 \begin_inset Text
2623
2624 \begin_layout Plain Layout
2625
2626 \end_layout
2627
2628 \end_inset
2629 </cell>
2630 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2631 \begin_inset Text
2632
2633 \begin_layout Plain Layout
2634 Marked in ctest, Assigned label
2635 \end_layout
2636
2637 \end_inset
2638 </cell>
2639 <cell multicolumn="2" alignment="center" valignment="top" usebox="none">
2640 \begin_inset Text
2641
2642 \begin_layout Plain Layout
2643
2644 \end_layout
2645
2646 \end_inset
2647 </cell>
2648 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2649 \begin_inset Text
2650
2651 \begin_layout Plain Layout
2652
2653 \end_layout
2654
2655 \end_inset
2656 </cell>
2657 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2658 \begin_inset Text
2659
2660 \begin_layout Plain Layout
2661
2662 \end_layout
2663
2664 \end_inset
2665 </cell>
2666 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2667 \begin_inset Text
2668
2669 \begin_layout Plain Layout
2670
2671 \end_layout
2672
2673 \end_inset
2674 </cell>
2675 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2676 \begin_inset Text
2677
2678 \begin_layout Plain Layout
2679
2680 \end_layout
2681
2682 \end_inset
2683 </cell>
2684 <cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2685 \begin_inset Text
2686
2687 \begin_layout Plain Layout
2688
2689 \end_layout
2690
2691 \end_inset
2692 </cell>
2693 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2694 \begin_inset Text
2695
2696 \begin_layout Plain Layout
2697
2698 \end_layout
2699
2700 \end_inset
2701 </cell>
2702 </row>
2703 <row>
2704 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2705 \begin_inset Text
2706
2707 \begin_layout Plain Layout
2708 Ignored
2709 \end_layout
2710
2711 \end_inset
2712 </cell>
2713 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2714 \begin_inset Text
2715
2716 \begin_layout Plain Layout
2717 Unreliable
2718 \end_layout
2719
2720 \end_inset
2721 </cell>
2722 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2723 \begin_inset Text
2724
2725 \begin_layout Plain Layout
2726 Suspicious
2727 \end_layout
2728
2729 \end_inset
2730 </cell>
2731 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2732 \begin_inset Text
2733
2734 \begin_layout Plain Layout
2735 Suspended
2736 \end_layout
2737
2738 \end_inset
2739 </cell>
2740 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2741 \begin_inset Text
2742
2743 \begin_layout Plain Layout
2744 export
2745 \end_layout
2746
2747 \end_inset
2748 </cell>
2749 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
2750 \begin_inset Text
2751
2752 \begin_layout Plain Layout
2753
2754 \end_layout
2755
2756 \end_inset
2757 </cell>
2758 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2759 \begin_inset Text
2760
2761 \begin_layout Plain Layout
2762 unreliable
2763 \end_layout
2764
2765 \end_inset
2766 </cell>
2767 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
2768 \begin_inset Text
2769
2770 \begin_layout Plain Layout
2771
2772 \end_layout
2773
2774 \end_inset
2775 </cell>
2776 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2777 \begin_inset Text
2778
2779 \begin_layout Plain Layout
2780 inverted
2781 \end_layout
2782
2783 \end_inset
2784 </cell>
2785 <cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none">
2786 \begin_inset Text
2787
2788 \begin_layout Plain Layout
2789
2790 \end_layout
2791
2792 \end_inset
2793 </cell>
2794 <cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
2795 \begin_inset Text
2796
2797 \begin_layout Plain Layout
2798 suspended
2799 \end_layout
2800
2801 \end_inset
2802 </cell>
2803 <cell multicolumn="2" alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2804 \begin_inset Text
2805
2806 \begin_layout Plain Layout
2807
2808 \end_layout
2809
2810 \end_inset
2811 </cell>
2812 </row>
2813 <row>
2814 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2815 \begin_inset Text
2816
2817 \begin_layout Plain Layout
2818 Yes
2819 \end_layout
2820
2821 \end_inset
2822 </cell>
2823 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2824 \begin_inset Text
2825
2826 \begin_layout Plain Layout
2827 -
2828 \end_layout
2829
2830 \end_inset
2831 </cell>
2832 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2833 \begin_inset Text
2834
2835 \begin_layout Plain Layout
2836 -
2837 \end_layout
2838
2839 \end_inset
2840 </cell>
2841 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2842 \begin_inset Text
2843
2844 \begin_layout Plain Layout
2845 -
2846 \end_layout
2847
2848 \end_inset
2849 </cell>
2850 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2851 \begin_inset Text
2852
2853 \begin_layout Plain Layout
2854 -
2855 \end_layout
2856
2857 \end_inset
2858 </cell>
2859 <cell alignment="center" valignment="top" topline="true" usebox="none">
2860 \begin_inset Text
2861
2862 \begin_layout Plain Layout
2863 -
2864 \end_layout
2865
2866 \end_inset
2867 </cell>
2868 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2869 \begin_inset Text
2870
2871 \begin_layout Plain Layout
2872 -
2873 \end_layout
2874
2875 \end_inset
2876 </cell>
2877 <cell alignment="center" valignment="top" topline="true" usebox="none">
2878 \begin_inset Text
2879
2880 \begin_layout Plain Layout
2881
2882 \end_layout
2883
2884 \end_inset
2885 </cell>
2886 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2887 \begin_inset Text
2888
2889 \begin_layout Plain Layout
2890 -
2891 \end_layout
2892
2893 \end_inset
2894 </cell>
2895 <cell alignment="center" valignment="top" topline="true" usebox="none">
2896 \begin_inset Text
2897
2898 \begin_layout Plain Layout
2899 -
2900 \end_layout
2901
2902 \end_inset
2903 </cell>
2904 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2905 \begin_inset Text
2906
2907 \begin_layout Plain Layout
2908 -
2909 \end_layout
2910
2911 \end_inset
2912 </cell>
2913 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
2914 \begin_inset Text
2915
2916 \begin_layout Plain Layout
2917 -
2918 \end_layout
2919
2920 \end_inset
2921 </cell>
2922 </row>
2923 <row>
2924 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2925 \begin_inset Text
2926
2927 \begin_layout Plain Layout
2928 No
2929 \end_layout
2930
2931 \end_inset
2932 </cell>
2933 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2934 \begin_inset Text
2935
2936 \begin_layout Plain Layout
2937 Yes
2938 \end_layout
2939
2940 \end_inset
2941 </cell>
2942 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2943 \begin_inset Text
2944
2945 \begin_layout Plain Layout
2946 -
2947 \end_layout
2948
2949 \end_inset
2950 </cell>
2951 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2952 \begin_inset Text
2953
2954 \begin_layout Plain Layout
2955 -
2956 \end_layout
2957
2958 \end_inset
2959 </cell>
2960 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2961 \begin_inset Text
2962
2963 \begin_layout Plain Layout
2964 -
2965 \end_layout
2966
2967 \end_inset
2968 </cell>
2969 <cell alignment="center" valignment="top" topline="true" usebox="none">
2970 \begin_inset Text
2971
2972 \begin_layout Plain Layout
2973 -
2974 \end_layout
2975
2976 \end_inset
2977 </cell>
2978 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2979 \begin_inset Text
2980
2981 \begin_layout Plain Layout
2982 -
2983 \end_layout
2984
2985 \end_inset
2986 </cell>
2987 <cell alignment="center" valignment="top" topline="true" usebox="none">
2988 \begin_inset Text
2989
2990 \begin_layout Plain Layout
2991 +
2992 \end_layout
2993
2994 \end_inset
2995 </cell>
2996 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
2997 \begin_inset Text
2998
2999 \begin_layout Plain Layout
3000 -
3001 \end_layout
3002
3003 \end_inset
3004 </cell>
3005 <cell alignment="center" valignment="top" topline="true" usebox="none">
3006 \begin_inset Text
3007
3008 \begin_layout Plain Layout
3009 -
3010 \end_layout
3011
3012 \end_inset
3013 </cell>
3014 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3015 \begin_inset Text
3016
3017 \begin_layout Plain Layout
3018 -
3019 \end_layout
3020
3021 \end_inset
3022 </cell>
3023 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3024 \begin_inset Text
3025
3026 \begin_layout Plain Layout
3027 -
3028 \end_layout
3029
3030 \end_inset
3031 </cell>
3032 </row>
3033 <row>
3034 <cell multirow="4" alignment="left" valignment="middle" topline="true" leftline="true" usebox="none">
3035 \begin_inset Text
3036
3037 \begin_layout Plain Layout
3038
3039 \end_layout
3040
3041 \end_inset
3042 </cell>
3043 <cell multirow="3" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3044 \begin_inset Text
3045
3046 \begin_layout Plain Layout
3047 No
3048 \end_layout
3049
3050 \end_inset
3051 </cell>
3052 <cell multirow="3" alignment="left" valignment="middle" topline="true" bottomline="true" leftline="true" usebox="none">
3053 \begin_inset Text
3054
3055 \begin_layout Plain Layout
3056 Yes
3057 \end_layout
3058
3059 \end_inset
3060 </cell>
3061 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3062 \begin_inset Text
3063
3064 \begin_layout Plain Layout
3065 Yes
3066 \end_layout
3067
3068 \end_inset
3069 </cell>
3070 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3071 \begin_inset Text
3072
3073 \begin_layout Plain Layout
3074 -
3075 \end_layout
3076
3077 \end_inset
3078 </cell>
3079 <cell alignment="center" valignment="top" topline="true" usebox="none">
3080 \begin_inset Text
3081
3082 \begin_layout Plain Layout
3083 -
3084 \end_layout
3085
3086 \end_inset
3087 </cell>
3088 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3089 \begin_inset Text
3090
3091 \begin_layout Plain Layout
3092 -
3093 \end_layout
3094
3095 \end_inset
3096 </cell>
3097 <cell alignment="center" valignment="top" topline="true" usebox="none">
3098 \begin_inset Text
3099
3100 \begin_layout Plain Layout
3101 -
3102 \end_layout
3103
3104 \end_inset
3105 </cell>
3106 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3107 \begin_inset Text
3108
3109 \begin_layout Plain Layout
3110 +
3111 \end_layout
3112
3113 \end_inset
3114 </cell>
3115 <cell alignment="center" valignment="top" topline="true" usebox="none">
3116 \begin_inset Text
3117
3118 \begin_layout Plain Layout
3119 -
3120 \end_layout
3121
3122 \end_inset
3123 </cell>
3124 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3125 \begin_inset Text
3126
3127 \begin_layout Plain Layout
3128 -
3129 \end_layout
3130
3131 \end_inset
3132 </cell>
3133 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3134 \begin_inset Text
3135
3136 \begin_layout Plain Layout
3137 +
3138 \end_layout
3139
3140 \end_inset
3141 </cell>
3142 </row>
3143 <row>
3144 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3145 \begin_inset Text
3146
3147 \begin_layout Plain Layout
3148
3149 \end_layout
3150
3151 \end_inset
3152 </cell>
3153 <cell multirow="4" alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
3154 \begin_inset Text
3155
3156 \begin_layout Plain Layout
3157
3158 \end_layout
3159
3160 \end_inset
3161 </cell>
3162 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3163 \begin_inset Text
3164
3165 \begin_layout Plain Layout
3166
3167 \end_layout
3168
3169 \end_inset
3170 </cell>
3171 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3172 \begin_inset Text
3173
3174 \begin_layout Plain Layout
3175 No
3176 \end_layout
3177
3178 \end_inset
3179 </cell>
3180 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3181 \begin_inset Text
3182
3183 \begin_layout Plain Layout
3184 -
3185 \end_layout
3186
3187 \end_inset
3188 </cell>
3189 <cell alignment="center" valignment="top" topline="true" usebox="none">
3190 \begin_inset Text
3191
3192 \begin_layout Plain Layout
3193 +
3194 \end_layout
3195
3196 \end_inset
3197 </cell>
3198 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3199 \begin_inset Text
3200
3201 \begin_layout Plain Layout
3202 -
3203 \end_layout
3204
3205 \end_inset
3206 </cell>
3207 <cell alignment="center" valignment="top" topline="true" usebox="none">
3208 \begin_inset Text
3209
3210 \begin_layout Plain Layout
3211 -
3212 \end_layout
3213
3214 \end_inset
3215 </cell>
3216 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3217 \begin_inset Text
3218
3219 \begin_layout Plain Layout
3220 +
3221 \end_layout
3222
3223 \end_inset
3224 </cell>
3225 <cell alignment="center" valignment="top" topline="true" usebox="none">
3226 \begin_inset Text
3227
3228 \begin_layout Plain Layout
3229 +
3230 \end_layout
3231
3232 \end_inset
3233 </cell>
3234 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
3235 \begin_inset Text
3236
3237 \begin_layout Plain Layout
3238 -
3239 \end_layout
3240
3241 \end_inset
3242 </cell>
3243 <cell alignment="center" valignment="top" topline="true" rightline="true" usebox="none">
3244 \begin_inset Text
3245
3246 \begin_layout Plain Layout
3247 -
3248 \end_layout
3249
3250 \end_inset
3251 </cell>
3252 </row>
3253 <row>
3254 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3255 \begin_inset Text
3256
3257 \begin_layout Plain Layout
3258
3259 \end_layout
3260
3261 \end_inset
3262 </cell>
3263 <cell multirow="4" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3264 \begin_inset Text
3265
3266 \begin_layout Plain Layout
3267
3268 \end_layout
3269
3270 \end_inset
3271 </cell>
3272 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3273 \begin_inset Text
3274
3275 \begin_layout Plain Layout
3276 No
3277 \end_layout
3278
3279 \end_inset
3280 </cell>
3281 <cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3282 \begin_inset Text
3283
3284 \begin_layout Plain Layout
3285 -
3286 \end_layout
3287
3288 \end_inset
3289 </cell>
3290 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3291 \begin_inset Text
3292
3293 \begin_layout Plain Layout
3294 -
3295 \end_layout
3296
3297 \end_inset
3298 </cell>
3299 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3300 \begin_inset Text
3301
3302 \begin_layout Plain Layout
3303 +
3304 \end_layout
3305
3306 \end_inset
3307 </cell>
3308 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3309 \begin_inset Text
3310
3311 \begin_layout Plain Layout
3312 -
3313 \end_layout
3314
3315 \end_inset
3316 </cell>
3317 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3318 \begin_inset Text
3319
3320 \begin_layout Plain Layout
3321 -
3322 \end_layout
3323
3324 \end_inset
3325 </cell>
3326 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3327 \begin_inset Text
3328
3329 \begin_layout Plain Layout
3330 -
3331 \end_layout
3332
3333 \end_inset
3334 </cell>
3335 <cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none">
3336 \begin_inset Text
3337
3338 \begin_layout Plain Layout
3339 -
3340 \end_layout
3341
3342 \end_inset
3343 </cell>
3344 <cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
3345 \begin_inset Text
3346
3347 \begin_layout Plain Layout
3348 -
3349 \end_layout
3350
3351 \end_inset
3352 </cell>
3353 <cell alignment="center" valignment="top" topline="true" bottomline="true" rightline="true" usebox="none">
3354 \begin_inset Text
3355
3356 \begin_layout Plain Layout
3357 -
3358 \end_layout
3359
3360 \end_inset
3361 </cell>
3362 </row>
3363 </lyxtabular>
3364
3365 \end_inset
3366
3367
3368 \end_layout
3369
3370 \begin_layout Subsubsection
3371 check_load tests
3372 \end_layout
3373
3374 \begin_layout Standard
3375 These tests check whether a .lyx file loads without any terminal messages.
3376  They correspond to the manual operations of simply opening a .lyx file on
3377  the terminal, exiting LyX once the file is loaded, and then checking whether
3378  there is any output from the terminal.
3379  These tests are useful for catching malformed .lyx files and parsing bugs.
3380  They can also be used to find a .lyx file in which an instance of something
3381  happens.
3382  To do this, compile LyX with a local patch that outputs something to the
3383  terminal when an instance is found, and then run the check_load tests to
3384  see if any fail, which would mean that the situation occurs in the LyX
3385  documentation files corresponding to the failed tests.
3386  These tests are expectedly fragile: any LyX diagnostic message, which is
3387  not necessarily an error, would cause the tests to fail.
3388  Similarly, any message output by a library (e.g.
3389  Qt) would also cause failure.
3390  There are some messages that the check_load tests are instructed to ignore,
3391  which are stored in the file 
3392 \begin_inset Flex Code
3393 status collapsed
3394
3395 \begin_layout Plain Layout
3396 development/autotests/filterCheckWarnings
3397 \end_layout
3398
3399 \end_inset
3400
3401 .
3402 \end_layout
3403
3404 \begin_layout Standard
3405 Under cmake, the tests are labeled as 'load'.
3406 \end_layout
3407
3408 \begin_layout Subsubsection
3409 lyx21 tests
3410 \end_layout
3411
3412 \begin_layout Standard
3413 These tests combine lyx2lyx tests with check_load tests.
3414  They fail if either fails.
3415 \end_layout
3416
3417 \begin_layout Subsubsection
3418 URL tests
3419 \end_layout
3420
3421 \begin_layout Standard
3422 The URL tests are enabled with the 
3423 \begin_inset Flex Code
3424 status collapsed
3425
3426 \begin_layout Plain Layout
3427 -DLYX_ENABLE_URLTESTS=ON
3428 \end_layout
3429
3430 \end_inset
3431
3432  CMake flag and are useful for finding broken links in our documentation
3433  files.
3434  If a URL test fails, to see which link in particular was reported as broken,
3435  see the output in 
3436 \begin_inset Flex Code
3437 status collapsed
3438
3439 \begin_layout Plain Layout
3440 LastTest.log
3441 \end_layout
3442
3443 \end_inset
3444
3445 .
3446  These tests are extremely fragile (e.g.
3447  a test can depend on your Internet connection) and a failed URL test should
3448  not be taken too seriously.
3449  URL tests are labeled as 
3450 \family typewriter
3451 'url'.
3452 \end_layout
3453
3454 \begin_layout Paragraph
3455 Running URL tests
3456 \end_layout
3457
3458 \begin_layout Standard
3459 cmake is required to run the \SpecialChar LyX
3460  tests, running them is not implemented for
3461  autotools.
3462 \end_layout
3463
3464 \begin_layout Standard
3465 The appropriate commands are:
3466 \end_layout
3467
3468 \begin_layout Itemize
3469
3470 \family typewriter
3471 ctest -L url
3472 \family default
3473
3474 \begin_inset Newline newline
3475 \end_inset
3476
3477 runs all tests with label 
3478 \family typewriter
3479 'url'
3480 \end_layout
3481
3482 \begin_layout Itemize
3483
3484 \family typewriter
3485 ctest -R 'check_.*urls'
3486 \family default
3487
3488 \begin_inset Newline newline
3489 \end_inset
3490
3491 runs the tests 'check_accessible_urls'
3492 \end_layout
3493
3494 \begin_layout Standard
3495 Associated test results can be examined in ctest-log directory in files
3496  of the form 'LastFailed.*URLS.log'
3497 \end_layout
3498
3499 \begin_layout Section
3500 Development policies
3501 \end_layout
3502
3503 \begin_layout Standard
3504 This chapter lists some guidelines that should be followed.
3505  This list is not complete, and many guidelines are in separate chapters,
3506  such as 
3507 \begin_inset Quotes eld
3508 \end_inset
3509
3510 When is an update of the .lyx file format number needed?
3511 \begin_inset Quotes erd
3512 \end_inset
3513
3514  in Section 
3515 \begin_inset CommandInset ref
3516 LatexCommand ref
3517 reference "sec:When-is-an"
3518
3519 \end_inset
3520
3521 .
3522 \end_layout
3523
3524 \begin_layout Subsection
3525 When to set a fixed milestone?
3526 \end_layout
3527
3528 \begin_layout Standard
3529 Only set a fixed milestone (like 2.1.4 or 2.2.0) if at least one of the following
3530  holds:
3531 \end_layout
3532
3533 \begin_layout Enumerate
3534 Somebody is actively working on a fix.
3535 \end_layout
3536
3537 \begin_layout Enumerate
3538 The bug is so severe that it would block the release if it is not fixed.
3539 \end_layout
3540
3541 \begin_layout Standard
3542 If a bug is important, but nobody is working on it, and it is no showstopper,
3543  use a milestone like 2.1.x or 2.2.x.
3544  For all other bugs, do not set a milestone at all.
3545 \end_layout
3546
3547 \begin_layout Subsection
3548 Can we add rc entries in stable branch?
3549 \end_layout
3550
3551 \begin_layout Standard
3552 No.
3553  We are supposed to increase the prefs2prefs version number with such things.
3554 \end_layout
3555
3556 \begin_layout Section
3557 Documentation policies
3558 \end_layout
3559
3560 \begin_layout Standard
3561 The main documentation consists of these files:
3562 \end_layout
3563
3564 \begin_layout Description
3565 splash.lyx it is the first file you see after an installation.
3566  We assume that a new user sees this.
3567  It is therefore designed to be as simple as possible.
3568  Therefore please don't add any new formatting, only fix typos etc.
3569  Splash.lyx is up to date for \SpecialChar LyX
3570  2.1.x, currently maintained by Uwe Stöhr.
3571 \end_layout
3572
3573 \begin_layout Description
3574 Intro.lyx This is the manual new users will read to learn \SpecialChar LyX
3575 .
3576  It therefore uses a limited set of formatting.
3577  For example a standard document class.
3578  Since new users will first learn about the formatting possibilities of
3579  \SpecialChar LyX
3580  please keep this file that simple.
3581  Intro.lyx is up to date for \SpecialChar LyX
3582  2.1.x, currently maintained by Uwe Stöhr.
3583 \end_layout
3584
3585 \begin_layout Description
3586 Tutorial.lyx our tutorial.
3587  It must be always up to date.
3588  Normally there is nothing to add since we don't want to overwhelm new users
3589  with too much details.
3590  The will learn these details while using \SpecialChar LyX
3591  and we have special manuals.
3592  Tutorial.lyx is up to date for \SpecialChar LyX
3593  2.1.x, currently maintained by Uwe Stöhr.
3594 \end_layout
3595
3596 \begin_layout Description
3597 UserGuide.lyx our main user guide.
3598  It covers a mixture of basic and detailed information.
3599  Some information is also in the Math and EmbeddedObjects manual so that
3600  the UserGuide refers to these files.
3601  UserGuide.lyx is up to date for \SpecialChar LyX
3602  2.1.x, currently maintained by Uwe Stöhr.
3603 \end_layout
3604
3605 \begin_layout Description
3606 EmbeddedObjects.lyx a special manual to explain things like tables floats
3607  boxes etc.
3608  in all detail.
3609  EmbeddedObjects.lyx is up to date for \SpecialChar LyX
3610  2.1.x, currently maintained by Uwe
3611  Stöhr.
3612 \end_layout
3613
3614 \begin_layout Description
3615 Math.lyx a special manual to explain everything regarding math in all detail.
3616  Math.lyx is up to date for \SpecialChar LyX
3617  2.1.x, currently maintained by Uwe Stöhr.
3618 \end_layout
3619
3620 \begin_layout Description
3621 Additional.lyx this manual covers information that would be too much detail
3622  for the UserGuide or would make the UserGuide uncompilable or only compilable
3623  when installing a lot of special \SpecialChar LaTeX
3624 -packages.
3625  What should be in the UserGuide or better in Additional is a matter of
3626  taste.
3627  it is up to you to decide that.
3628  Additional.lyx is not completely up to date for \SpecialChar LyX
3629  2.1.x.
3630  Only chapter
3631 \begin_inset space ~
3632 \end_inset
3633
3634 8 is up to date and currently maintained by Uwe Stöhr.
3635  It certainly needs a rewrite and update.
3636  For example many info in chapter
3637 \begin_inset space ~
3638 \end_inset
3639
3640 2 and 3 are already covered by the UserGuide and/or the EmbeddedObjects
3641  manual.
3642 \end_layout
3643
3644 \begin_layout Description
3645 Customization.lyx this manual covers information how to customize \SpecialChar LyX
3646  for certain
3647  output formats, operating systems, languages etc.
3648  It is currently completely out of date and needs a major rewrite and update.
3649  If you do this please assure that your information are given for all OSes
3650  and \SpecialChar LaTeX
3651  distributions (meaning be as objective as possible).
3652 \end_layout
3653
3654 \begin_layout Standard
3655 There are only 4
3656 \begin_inset space ~
3657 \end_inset
3658
3659 rules in editing the docs:
3660 \end_layout
3661
3662 \begin_layout Enumerate
3663 If you are not the maintainer of a doc file or a chapter/section, you MUST
3664  use change tracking so that the maintainer could review your changes
3665 \end_layout
3666
3667 \begin_layout Enumerate
3668 Respect the formatting of the document.
3669  The different files use different formatting styles.
3670  That is OK and has historic reasons nobody fully know ;-).
3671  But it is important to be consistent within one file.
3672 \end_layout
3673
3674 \begin_layout Enumerate
3675 All changes you make to a file in one language MUST also go the file in
3676  the other actively maintained languages.
3677  Normally the maintainer does this for you, if you are the maintainer, you
3678  must do this by copying or changing the changed or added text to the other
3679  files so that the translators sees the blue underlined text and know what
3680  they have to translate and what was changed.
3681 \end_layout
3682
3683 \begin_layout Enumerate
3684 You MUST assure that the document is compilable as 
3685 \begin_inset Quotes eld
3686 \end_inset
3687
3688 PDF (pdflatex)
3689 \begin_inset Quotes erd
3690 \end_inset
3691
3692  after your changes.
3693 \end_layout
3694
3695 \end_body
3696 \end_document