1 # Sample test script for regression tests
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
6 # WARNING: Syntax is poorly parsed: no extra spaces anywhere
8 # Lines starting with a '#' on the 1st column are comments
11 # Causes the execution of <cmd...> in a os.system()
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...>.
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
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:
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.
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
44 # Feeds the running LyX instance with the specified key characters.
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
52 # Changes the delay among typed charactes to n milliseconds.
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
60 # Write a comment-notice to the control file. Will be output when processed
61 # by 'searchPatterns.pl' script.
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
69 # It is an error if this pattern matches before the expected (either CP: or CR:)
70 # Expand pattern like in CP:
73 # Write a pattern to the control file. Pattern will be used directly (no conversion).
76 # It is an error if this pattern matches before the expected (either CP: or CR:)
79 # Close the control file. The file is also closed at 'TestEndWithKill' and 'TestEnd'
83 # Single delay of f seconds.
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
90 TestBegin test.lyx -dbg key > hello-world.loga.txt 2>&1
93 KK: \Axbuffer-export latex\[Return]
94 TestEnd grep "Hello World" test.tex