Skip to content

Commit e77bd22

Browse files
authored
tests: fix to pass with non-verbose libcurl build (#423)
Building libcurl with `CURL_DISABLE_VERBOSE_STRINGS` changes some stderr outputs. Before this patch, this caused such build to fail 3 tests. Fix and verify with these updates: - test.py: support multiple accepted stderr result. - tests.json: add alternate expected stderr results, as emitted by non-verbose libcurl. - GHA/curl-for-win: add Linux job to actually test this issue. Oddly, Windows passes tests. This is due to a WINE workaround in `test.py` which replaces actual result with the expected one, masking failures.
1 parent 46162a2 commit e77bd22

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

.github/workflows/curl-for-win.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,29 @@ jobs:
5656
5757
- name: 'list dependencies'
5858
run: cat urls.txt
59+
60+
linux-glibc-gcc-minimal: # use gcc to minimize installed packages
61+
name: 'Linux gcc glibc minimal'
62+
runs-on: ubuntu-latest
63+
timeout-minutes: 5
64+
steps:
65+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
66+
with:
67+
persist-credentials: false
68+
path: 'trurl'
69+
fetch-depth: 8
70+
- name: 'build'
71+
run: |
72+
git clone --depth 1 https://github.com/curl/curl-for-win
73+
mv curl-for-win/* .
74+
export CW_CONFIG='-dev-zero-linux-x64-gcc'
75+
export CW_REVISION="${GITHUB_SHA}"
76+
. ./_versions.sh
77+
sudo podman image trust set --type reject default
78+
sudo podman image trust set --type accept docker.io/library
79+
time podman pull "${OCI_IMAGE_DEBIAN}"
80+
time podman run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \
81+
--env-file <(env | grep -a -E \
82+
'^(CW_|GITHUB_)') \
83+
"${OCI_IMAGE_DEBIAN}" \
84+
sh -c ./_ci-linux-debian.sh

test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ def testComponent(value, exp):
5858
return result
5959
else:
6060
return not result
61+
elif isinstance(exp, list):
62+
for alt in exp:
63+
if value == alt:
64+
return True
6165

6266
return value == exp
6367

tests.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,10 @@
19741974
"expected": {
19751975
"stdout": "",
19761976
"returncode": 9,
1977-
"stderr": "trurl error: Bad scheme [hello]\ntrurl error: Try trurl -h for help\n"
1977+
"stderr": [
1978+
"trurl error: Bad scheme [hello]\ntrurl error: Try trurl -h for help\n",
1979+
"trurl error: Error [hello]\ntrurl error: Try trurl -h for help\n"
1980+
]
19781981
}
19791982
},
19801983
{
@@ -2018,7 +2021,10 @@
20182021
"expected": {
20192022
"stdout": "https://example.org/\ngit://curl.se/\n",
20202023
"returncode": 0,
2021-
"stderr": "trurl note: Bad scheme [foo]\ntrurl note: Bad scheme [hi]\ntrurl note: Bad scheme [hey]\n"
2024+
"stderr": [
2025+
"trurl note: Bad scheme [foo]\ntrurl note: Bad scheme [hi]\ntrurl note: Bad scheme [hey]\n",
2026+
"trurl note: Error [foo]\ntrurl note: Error [hi]\ntrurl note: Error [hey]\n"
2027+
]
20222028
}
20232029
},
20242030
{
@@ -2767,7 +2773,10 @@
27672773
]
27682774
},
27692775
"expected": {
2770-
"stderr": "trurl note: URL decode error, most likely because of rubbish in the input (query)\n",
2776+
"stderr": [
2777+
"trurl note: URL decode error, most likely because of rubbish in the input (query)\n",
2778+
"trurl note: Error (query)\n"
2779+
],
27712780
"returncode": 0,
27722781
"stdout": "\n"
27732782
}

0 commit comments

Comments
 (0)