kyua-debug man page

debug — Executes a single test case with facilities for debugging

Synopsis

debug [--build-root path] [--kyuafile file] [--stdout path] [--stderr path] test_case

Description

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:

The following subcommand options are recognized:

--build-root path
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.
--kyuafile file, -k file
Specifies the Kyuafile to process. Defaults to Kyuafile file in the current directory.
--stderr path
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.
--stdout path
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.

Exit Status

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).

See Also

kyua(1), kyua-build-root(7), kyua-test-filters(7)

Referenced By

kyua(1), kyua-build-root(7), kyua-test(1), kyua-test-filters(7).

September 9, 2012