15.3.3.1 Command-line arguments for test drivers

A custom driver can rely on various command-line options and arguments being passed to it automatically by the Automake-generated test harness. It is mandatory that it understands all of them (even if the exact interpretation of the associated semantics can legitimately change between a test driver and another, and even be a no-op in some drivers). Options are separated from their arguments by whitespace.4

Here is the list of options:

--test-name NAME

The name of the test, with VPATH prefix (if any) removed. This can have a suffix and a directory component (as in e.g., sub/foo.test), and is mostly meant to be used in console reports about testsuite advancements and results (see Testsuite progress output).

--log-file PATH.log

The .log file the test driver must create (see Basics of test metadata). If it has a directory component (as in e.g., sub/foo.log), the test harness will ensure that such directory exists before the test driver is called.

--trs-file PATH.trs

The .trs file the test driver must create (see Basics of test metadata). If it has a directory component (as in e.g., sub/foo.trs), the test harness will ensure that such directory exists before the test driver is called.

--color-tests {yes|no}

Whether the console output should be colorized or not (see Simple tests and color-tests, to learn when this option gets activated and when it doesn’t).

--collect-skipped-logs {yes|no}

Whether to include the logs of skipped tests in the global test-suite.log file.

--expect-failure {yes|no}

Whether the tested program is expected to fail.

--enable-hard-errors {yes|no}

Whether “hard errors” in the tested program should be treated differently from normal failures or not (the default should be yes). The exact meaning of “hard error” is highly dependent from the test protocols or conventions in use.

--

Explicitly terminate the list of options.

The first non-option argument passed to the test driver is the program to be run, and all the following ones are command-line options and arguments for this program.

Exact semantics attached to the --color-tests, --collect-skipped-logs, --expect-failure, and --enable-hard-errors options are left up to the individual test drivers. Still, having a behavior compatible or at least similar to that provided by the default driver is advised, as that results in better consistency and thus a more pleasant user experience.


Footnotes

(4)

Regrettably, older versions of this manual stated that option arguments should be joined to their options with a = character, rather than passed as in the following argument word as shown here. The syntax with = has never been accepted by the test drivers supplied with Automake, and has never been produced by Makefiles generated by Automake.