This is a follow up to D63600 that attempts to fix the test to work on all platforms including Windows (which the previous patch broke) and Solaris (which is the original motivation for this patch).
Details
- Reviewers
ro rnk jkorous - Commits
- rG8950d0a1f062: Fix test cl-response-file.c to work on all platforms including Windows/Solaris.
rL364245: Fix test cl-response-file.c to work on all platforms including Windows/Solaris.
rC364245: Fix test cl-response-file.c to work on all platforms including Windows/Solaris.
Diff Detail
- Repository
- rL LLVM
Event Timeline
I would almost prefer to XFAIL this on Solaris, I feel like the intent is clearer with echo.
Please have a look at what the autoconf manual has to say on echo vs. printf:
That's the reason configure has switched to use printf instead, which my testing in https://reviews.llvm.org/D63600 confirms: echo
is a nightmare in cross-platform use. Besides, there are already many uses of printf in the testsuite, so there's no reason to be reluctant
about this one. Besides, there's no reason whatsoever that the test wouldn't fail again on the next target due to issues with echo.
Yikes, fair enough.
I actually really wish lit had some support for the here-document pattern:
cat <<EOF $foo EOF
We could replace many uses of echo in our test suite with this, but it's not clear how it interacts when prefixed with # RUN: , and we'd have to implement it in the builtin lit shell for Windows. I proposed a tool to extract such tagged regions from a file before, but some senior contributors opposed it.