Repository navigation
Test suite fixes and improvements for Windows - #780
Merged
Merged
Conversation
In some cases test names would be interpreted as invalid arguments to `printf` instead of a string to be printed, and this resulted in confusing output on test failure.
git-bash's `ln -s` defaults to making a copy instead of making a symlink for compatibility, but it is possible to ask for native Windows symlink support instead. Creating symlinks on Windows requires suitable permissions, or that "Developer Mode" is enabled. (This is true for the Github Actions Windows runners.)
On Windows, git-bash's emulation of fork/exec is exteremely slow -- on my machine it's typically around 30ms to spawn /usr/bin/true from a bash script compared to 2ms on my macOS machine. This is really noticeable when running ccache tests. This patch fixes some of the hot code (i.e. code invoked for every test case) to avoid spawning external commands or creating as many subshells.
- account for \r\n line endings in --version test - skip tests that can never succeed on Windows
nickhutchinson
force-pushed
the
work/win-test-fixes
branch
from
January 16, 2021 17:55
7d875a9 to
c9d32ff
Compare
Member
|
Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small tweaks to get more tests passing on Windows: account for
\r\nline endings inccache --versiontest, and skip some tests that can never succeed on Windows.I noticed that having more tests running on Windows would increase CI test run times by a few minutes. This seems to be due to git-bash's emulation of fork/exec being extremely slow -- on my machine it's roughly 30ms to spawn
/usr/bin/truefrom a bash script compared to 2ms on my macOS machine. So I've also made some tweaks to improve performance on Windows by avoiding unneeded subshells.Also fixes some other issues with the test suite:
CCwasn't handled properly in some casesprintf, which caused some confusing errors when the test started with a-.