Debian Codegraph @

test/README.md

raw
1 crazy-complete tests
2 --------------------
3
4 This directory contains all the tests for the **crazy-complete** project.
5 The tests are organized into specific categories to ensure functionality and proper error handling.
6
7 Root test directory
8 -------------------
9
10 - **./run.sh**
11
12 - This script serves as the main entry point for running all tests within
13 the `test` directory.
14
15 - **Usage**: To run all tests, simply execute `./run.sh`
16 Any additional options are passed to `./tests/run.py`.
17
18 Test subdirectories
19 -------------------
20
21 - **./tests/run.py**
22
23 - Contains the primary tests focused on checking the functionality of
24 generated completion scripts.
25
26 - **Execution methods**
27
28 - `--driver=tmux`:
29 This is the default driver.
30 It uses `tmux` to emulate terminals.
31
32 - `--driver=pyte`:
33 This requires the python modules `pyte` and `pexpect` to be installed.
34 This driver has been disabled, because the Fish shell started using
35 the `kitty` protocol which is not supported by `pyte`.
36
37 - **Usage**: `./tests/run.py [OPTIONS]`
38
39 - `-d|--driver <DRIVER>`:
40 As stated above, this option is used to specify the execution method.
41
42 - `-t|--threads <NUM>`:
43 Sets how many threads per shell shall be used while testing.
44 The default is `1` to ensure there are no problems even on slow systems.
45 However, a value of `5` is recommended on normal systems.
46
47 - `-w|--wait <SECONDS>`:
48 Sets how many seconds to wait for completion output per test.
49 The default is `5` to ensure there are no problems even on slow systems.
50 However, a value of `1` is recommended on normal systems.
51
52 - `-s|--select <DEFINITION_FILE>`:
53 Execute only tests that use the specified definition file.
54 Useful for developing or debugging a specific feature without having to
55 run all tests.
56
57 - `-f|--fast`:
58 Makes the tests run even faster at the cost of corectness for some tests.
59 For tests where the input matches the expected output, these tests will always pass.
60
61 - The script writes a file named `./tests/tests.new.yaml`.
62 If the tests fail, this file can be diffed against `./tests/tests.yaml`.
63
64 - **./conversion/run.sh**
65
66 - Simple tests that validate JSON and YAML conversion.
67
68 - Also includes simple tests for parsing the help output.
69
70 - **Usage**: `./test/conversion/run.sh`
71
72 - **./error_messages/run.py**
73
74 - Includes tests specifically designed to validate error handling.
75
76 - Verifies that the tool provides meaningful error messages when misued,
77 ensuring user feedback is clear and helpful.
78
79 - **Usage**: `./error_messages/run.py`