]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: add -q as first option when invoking curl for tests
authorDaniel Stenberg <daniel@haxx.se>
Tue, 16 Apr 2024 12:18:55 +0000 (14:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 16 Apr 2024 21:40:23 +0000 (23:40 +0200)
To reduce the risk that the user running the tests has a .curlrc present
that messes things up.

Support 'option="no-q"' for the <command> tag to switch it off on demand.
Use this new feature in test 433 and 436.

Ref: #13284
Closes #13387

tests/FILEFORMAT.md
tests/data/test433
tests/data/test436
tests/runner.pm

index b594fc113081408bce7b0b35c7c88cd47ddffd61..d4dd85b5ef867296ad30663d6741beb91b513a5c 100644 (file)
@@ -531,7 +531,7 @@ command has been run.
 If the variable name has no assignment, no `=`, then that variable is just
 deleted.
 
-### `<command [option="no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
+### `<command [option="no-q/no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
 Command line to run.
 
 Note that the URL that gets passed to the server actually controls what data
@@ -562,6 +562,9 @@ otherwise written to verify stdout.
 Set `option="no-include"` to prevent the test script to slap on the
 `--include` argument.
 
+Set `option="no-q"` avoid using `-q` as the first argument in the curl command
+line.
+
 Set `option="binary-trace"` to use `--trace` instead of `--trace-ascii` for
 tracing. Suitable for binary-oriented protocols such as MQTT.
 
index e86f3deaeb5b68332d0010231ad53aa9dd09c0a8..f6505d0328d97d8341f30e7c05a61cc2211293ec 100644 (file)
@@ -36,7 +36,7 @@ CURL_HOME=
 <name>
 Verify XDG_CONFIG_HOME use to find .curlrc
 </name>
-<command>
+<command option="no-q">
 %HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
index d435b5110d38a6471eb4e96ef05b99e91365d7ce..762ab3f91f12766a93f483b59427627be8a2c2fe 100644 (file)
@@ -35,7 +35,7 @@ XDG_CONFIG_HOME=
 <name>
 Find .curlrc in .config/curlrc via CURL_HOME
 </name>
-<command>
+<command option="no-q">
 %HOSTIP:%HTTPPORT/%TESTNUMBER
 </command>
 </client>
index 645905e5f692e86259a68c4d4cbadf718755f4d4..d02d40b7b449bac239bde3a4b2a0114b9dfb1348 100644 (file)
@@ -920,6 +920,9 @@ sub singletest_run {
 
     if(!$tool) {
         $CMDLINE=shell_quote($CURL);
+        if($cmdhash{'option'} !~ /no-q/) {
+            $CMDLINE .= " -q";
+        }
     }
 
     if(use_valgrind() && !$disablevalgrind) {