]> git.cworth.org Git - apitrace-tests/blob - cli/README.markdown
Merge branch 'trim-auto'
[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 by convention. The scripts must be listed explicitly in the
14 CMakeLists.txt file. Each script consists of simple line-based
15 commands with the following meanings (based on the first word of each
16 line):
17
18   apitrace:     Execute the current apitrace executable being tested
19                 with the given arguments. If apitrace returns a
20                 non-zero status, the test will fail.
21
22   expect:       Compare the results of the previously-executed command
23                 with the given (json-quoted) string. If the strings
24                 are not identical, the test will fail.
25
26   rm_and_mkdir: Remove any existing directory of the given name and
27                 then create it. The directory name is always
28                 interpreted locally. If this fails for any reason
29                 other than "file does not exist" the test will fail.
30
31 Note: Blank lines and lines beginning with '#' are ignored.
32
33 Commands can be prefixed with "EXPECT_FAILURE:" to indicate that a
34 command is expected to return a non-zero value. In this case, a return
35 value of zero from the command will cause the test to fail.
36
37 If none of the commands in the script cause the test to fail (as
38 described above), then the test will pass.
39