kyua-debug man page
debug — Executes a single test case with facilities for debugging
|debug|| [--build-root |
The debug command provides a mechanism to execute a single test case bypassing some of the Kyua infrastructure and allowing the user to poke into the execution behavior of the test.
The test case to run is selected by providing a test filter that matches a single test case; see kyua-test-filters(7). The test case is executed and its result is printed as the last line of the output of the tool.
At the moment, the debug command allows the following aspects of a test case execution to be tweaked:
- Redirection of the test case's stdout and stderr to the console (the default) or to arbitraty files. See the --stdout and --stderr options below.
The following subcommand options are recognized:
- Specifies the build root in which to find the test programs referenced by the Kyuafile, if different from the Kyuafile's directory. See kyua-build-root(7) for more information.
- Specifies the Kyuafile to process. Defaults to
Kyuafilefile in the current directory.
- Specifies the file to which to send the standard error of the test program's body. The default is
/dev/stderr, which is a special that redirects the output to the console.
- Specifies the file to which to send the standard output of the test program's body. The default is
/dev/stdout, which is a special that redirects the output to the console.
For example, consider the following Kyua session:
$ kyua test kernel/fs:mkdir -> passed kernel/fs:rmdir -> failed: Invalid argument 1/2 passed (1 failed)
At this point, we do not have a lot of information regarding the failure of the ‘kernel/fs:rmdir’ test. We can run this test through the debug command to inspect its output a bit closer, hoping that the test case is kind enough to log its progress:
$ kyua debug kernel/fs:rmdir Trying rmdir('foo') Trying rmdir(NULL) kernel/fs:rmdir -> failed: Invalid argument
Luckily, the offending test case was printing status lines as it progressed, so we could see the last attempted call and we can know match the failure message to the problem.
The debug command returns 0 if the test case passes or 1 if the test case fails.
Additional exit codes may be returned as described in kyua(1).
kyua(1), kyua-build-root(7), kyua-test-filters(7)
kyua(1), kyua-build-root(7), kyua-test(1), kyua-test-filters(7).