1KYUA-LIST(1) BSD General Commands Manual KYUA-LIST(1)
2
4 kyua list — Lists test cases and their metadata
5
7 kyua list [--build-root path] [--kyuafile file] [--verbose] test_case1
8 [.. test_caseN]
9
11 The kyua list command scans all the test programs and test cases in a
12 test suite (as defined by a kyuafile(5)) and prints a list of all their
13 names, optionally accompanied by any metadata properties they have.
14
15 The optional arguments to kyua list are used to select which test pro‐
16 grams or test cases to run. These are filters and are described below in
17 Test filters.
18
19 This command must be run within a test suite or a test suite must be pro‐
20 vided with the --kyuafile flag.
21
22 The following subcommand options are recognized:
23
24 --build-root path
25 Specifies the build root in which to find the test programs refer‐
26 enced by the Kyuafile, if different from the Kyuafile's directory.
27 See Build directories below for more information.
28
29 --kyuafile path, -k path
30 Specifies the Kyuafile to process. Defaults to a Kyuafile file in
31 the current directory.
32
33 --verbose, -v
34 Prints metadata properties for every test case.
35
36 Build directories
37 Build directories (or object directories, target directories, product
38 directories, etc.) is the concept that allows a developer to keep the
39 source tree clean from build products by asking the build system to place
40 such build products under a separate subtree.
41
42 Most build systems today support build directories. For example, the GNU
43 Automake/Autoconf build system exposes such concept when invoked as fol‐
44 lows:
45
46 $ cd my-project-1.0
47 $ mkdir build
48 $ cd build
49 $ ../configure
50 $ make
51
52 Under such invocation, all the results of the build are left in the
53 my-project-1.0/build/ subdirectory while maintaining the contents of
54 my-project-1.0/ intact.
55
56 Because build directories are an integral part of most build systems, and
57 because they are a tool that developers use frequently, kyua list sup‐
58 ports build directories too. This manifests in the form of kyua list
59 being able to run tests from build directories while reading the (often
60 immutable) test suite definition from the source tree.
61
62 One important property of build directories is that they follow (or need
63 to follow) the exact same layout as the source tree. For example, con‐
64 sider the following directory listings:
65
66 src/Kyuafile
67 src/bin/ls/
68 src/bin/ls/Kyuafile
69 src/bin/ls/ls.c
70 src/bin/ls/ls_test.c
71 src/sbin/su/
72 src/sbin/su/Kyuafile
73 src/sbin/su/su.c
74 src/sbin/su/su_test.c
75
76 obj/bin/ls/
77 obj/bin/ls/ls*
78 obj/bin/ls/ls_test*
79 obj/sbin/su/
80 obj/sbin/su/su*
81 obj/sbin/su/su_test*
82
83 Note how the directory layout within src/ matches that of obj/. The src/
84 directory contains only source files and the definition of the test suite
85 (the Kyuafiles), while the obj/ directory contains only the binaries gen‐
86 erated during a build.
87
88 All commands that deal with the workspace support the --build-root path
89 option. When this option is provided, the directory specified by the
90 option is considered to be the root of the build directory. For example,
91 considering our previous fake tree layout, we could invoke kyua list as
92 any of the following:
93
94 $ kyua list --kyuafile=src/Kyuafile --build-root=obj
95 $ cd src && kyua list --build-root=../obj
96
97 Test filters
98 A test filter is a string that is used to match test cases or test pro‐
99 grams in a test suite. Filters have the following form:
100
101 test_program_name[:test_case_name]
102
103 Where ‘test_program_name’ is the name of a test program or a subdirectory
104 in the test suite, and ‘test_case_name’ is the name of a test case.
105
107 The kyua list command returns 0 on success or 1 if any of the given test
108 case filters does not match any test case.
109
110 Additional exit codes may be returned as described in kyua(1).
111
113 kyua(1), kyuafile(5)
114
115BSD October 13, 2014 BSD