tests: support switching off the stdout redirect per-test
No binary (build failed)
—
(log yok)
| @@ -589,7 +589,7 @@ command has been run. | |
| If the variable name has no assignment, no `=`, then that variable is deleted. | |
| - | ### `<command [option="no-q/no-output/no-include/no-memdebug/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>` |
| + | ### `<command [option="no-q/no-output/no-stdout/no-include/no-memdebug/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>` |
| Command line to run. | |
| If the command spans multiple lines, they are concatenated with a space added | |
| @@ -605,6 +605,9 @@ Set `option="no-output"` to prevent the test script to slap on the `--output` | |
| argument that directs the output to a file. The `--output` is also not added | |
| if the verify/stdout section is used. | |
| + | Set `option="no-stdout"` to prevent the normal stdout redirect template to be |
| + | applied on the command line to run. |
| + | |
| Set `option="force-output"` to make use of `--output` even when the test is | |
| otherwise written to verify stdout. | |
| @@ -991,8 +991,12 @@ sub singletest_run { | |
| $CMDLINE = "$valgrindcmd $CMDLINE"; | |
| } | |
| - | $CMDLINE .= "$cmdargs > " . stdoutfilename($LOGDIR, $testnum) . |
| - | " 2> " . stderrfilename($LOGDIR, $testnum); |
| + | my $redirstdout = "> " . stdoutfilename($LOGDIR, $testnum); |
| + | if($cmdhash{'option'} && ($cmdhash{'option'} =~ /no-stdout/)) { |
| + | $redirstdout = ""; |
| + | } |
| + | $CMDLINE .= "$cmdargs $redirstdout". |
| + | " 2> " . stderrfilename($LOGDIR, $testnum); |
| if($verbose) { | |
| logmsg "$CMDLINE\n"; | |