diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-11 10:26:06 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-11 13:16:02 +0100 |
commit | e12825c642a88774e19ba0ef7c88f676793a1e5b (patch) | |
tree | a954c0bf5a85d2f9850fec0a71c01b77dcdd8465 /tests/FILEFORMAT.md | |
parent | 117b94eb0b384af039225b557df5460519d3bbfc (diff) | |
download | curl-e12825c642a88774e19ba0ef7c88f676793a1e5b.tar.gz |
runtests: add support for %if [feature] conditions
... to make tests run differently or expect different results depending
on what features that are present or not in curl.
Bonus: initial minor 'Hyper' awareness but nothing is using that yet
Closes #6304
Diffstat (limited to 'tests/FILEFORMAT.md')
-rw-r--r-- | tests/FILEFORMAT.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index ce4459a29..1e9513466 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -68,6 +68,36 @@ For example, to insert the word hello a 100 times: %repeat[100 x hello]% +## Conditional lines + +Lines in the test file can be made to appear conditionally on a specific +feature (see the "features" section below) being set or not set. If the +specific feature is present, the following lines will be output, otherwise it +outputs nothing, until a following else or endif clause. Like this: + + %if brotli + Accept-Encoding + %endif + +It can also check for the inversed condition, so if the feature us *not* set by +the use of an exclamation mark: + + %if !brotli + Accept-Encoding: not-brotli + %endif + +You can also make an "else" clause to get output for the opposite condition, +like: + + %if brotli + Accept-Encoding: brotli + %else + Accept-Encoding: nothing + %endif + +**Note** that there can be no nested conditions. You can only do one +conditional at a time and you can only check for a single feature in it. + # Variables When the test is preprocessed, a range of "variables" in the test file will be @@ -344,6 +374,7 @@ Features testable here are: - `HSTS` - `HTTP-auth` - `http/2` +- `hyper` - `idn` - `ipv6` - `Kerberos` |