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