]> git.cworth.org Git - apitrace-tests/blob - cli/README.markdown
Add a new 'cli' subdirectory for higher-level testing of apitrace CLI.
[apitrace-tests] / cli / README.markdown
1 This directory tests high-level functionality of apitrace command-line
2 interface (cli). See also the neighboring "traces" directory which
3 also tests the cli, but in ways that can only be verified by doing
4 comparisons of resulting dump files.
5
6 For writing new tests, if the functionality can be exercised by a
7 sequence of apitrace command invocations, and then a final comparison
8 of "apitrace dump" output, then it's likely simplest to write a new
9 test in the traces directory. Otherwise, a new test program can be
10 written in this directory.
11
12 The tests in this directory are found in files with names matching
13 *.script. The scripts are simple line-based commands with the
14 following meanings based on the first word of each line:
15
16   apitrace:     Execute the current apitrace executable being tested
17                 with the given arguments. If apitrace returns a
18                 non-zero status, the test will fail.
19
20   expect:       Compare the results of the previously-executed command
21                 with the given (json-quoted) string. If the strings
22                 are not identical, the test will fail.
23
24   rm_and_mkdir: Remove any existing directory of the given name and
25                 then create it. The directory name is always
26                 interpreted locally. If this fails for any reason
27                 other than "file does not exist" the test will fail.
28
29 If none of the commands in the script cause the test to fail, then the
30 test will pass.
31