]> git.lyx.org Git - lyx.git/blob - development/autotests/hello-world-in.txt
Merge branch 'master' of git.lyx.org:lyx
[lyx.git] / development / autotests / hello-world-in.txt
1 # Sample test script for regression tests
2 #
3 # Adapted from the syntax of the original testkeys.py by McCabe-Dansted.
4 # Run this script by providing it as single argument to run-test.sh
5 #
6 # WARNING: Syntax is poorly parsed: no extra spaces anywhere
7 #
8 # Lines starting with a '#' on the 1st column are comments
9 #
10 # Exec <cmd...>
11 #   Causes the execution of <cmd...> in a os.system()
12 #
13 # TestBegin <args...>
14 #   Starts a test case under deterministic conditions:
15 #   Any currently running instance of LyX is killed
16 #   A new LyX instance is spawned, with the command-line arguments
17 #   specified in <args...>.
18 #
19 # TestEndWithKill <cmd...>
20 #   Ends a test case, killing immidiately the LyX instance under test
21 #   Behaviour is otherwise the same as in 'TestEnd' below
22 #
23 # TestEnd <cmd...>
24 #   Ends a test case, closing the LyX instance under test, and
25 #   executing the <cmd...> commands into an os.system(). The exit status
26 #   of the commands sequence determines success or failure of the test.
27 #   This is equivalent to:
28 #     TestEnd
29 #     Assert <cmd...>
30 #
31 # Assert <cmd...>
32 #   Executes the <cmd...> commands into an os.system() and, if the
33 #   exit status is non-zero, then abort the test execution making it fail.
34 #
35 # Lang <lang>
36 #   Sets the environment variable LANG to <lang>. Useful before launching
37 #   LyX (i.e., before a TestBegin command, in order to set deterministically
38 #   the language settings, which impacts the actual key sequences needed to
39 #   operate within LyX. This way, different developers can write different
40 #   test cases in different languages and still they can be executed by
41 #   anyone.
42 #
43 # KK: <chars...>
44 #   Feeds the running LyX instance with the specified key characters.
45 #   Special sequences:
46 #     \A<char> ...... sends the sequence [Alt+<char>]
47 #     \[<dir>] ...... sends a cursor movement, <dir> = Right, Left, Up, Down
48 #     \[Tab] ........ sends a Tab character
49 #     \[Return] ..... sends a Return
50 #
51 # KD: n
52 #   Changes the delay among typed charactes to n milliseconds.
53 #
54 # CO: [>>] <filename>
55 #    Open control file for write (or append if preceeded with '>>').
56 #    This file will contain the search and comment strings.
57 #    Used only by the script 'searchPatterns.pl' at the end of test
58 #
59 # CN: <notice>
60 #    Write a comment-notice to the control file. Will be output when processed
61 #    by 'searchPatterns.pl' script.
62 #
63 # CP: <pattern>
64 #    Write a pattern to the control file. Special characters in this pattern
65 #    will be escaped to create a suitable regex.
66 #    The result will be applied on the lyx-log-file
67 #
68 # Cp: <pattern>
69 #    It is an error if this pattern matches before the expected (either CP: or CR:)
70 #    Expand pattern like in CP:
71 #
72 # CR: <regex pattern>
73 #    Write a pattern to the control file. Pattern will be used directly (no conversion).
74 #
75 # Cr: <regex pattern>
76 #    It is an error if this pattern matches before the expected (either CP: or CR:)
77 #
78 # CC:
79 #    Close the control file. The file is also closed at 'TestEndWithKill' and 'TestEnd'
80 #    implicitly.
81 #
82 # Sleep f
83 #   Single delay of f seconds.
84 #
85 #
86 # This example instructs LyX to type "Hello World", then exports it as
87 # LaTeX, and verifies that the typed characters are indeed present in the
88 # exported document.
89 #
90 TestBegin test.lyx -dbg key > hello-world.loga.txt 2>&1
91 KK: Hello World
92 KK: \Cs
93 KK: \Axbuffer-export latex\[Return]
94 TestEnd grep "Hello World" test.tex