[POSIX] convert Mac-specific functional tests to POSIX where viable#1529
Merged
chrisd8088 merged 3 commits intomicrosoft:masterfrom Sep 24, 2019
Merged
[POSIX] convert Mac-specific functional tests to POSIX where viable#1529chrisd8088 merged 3 commits intomicrosoft:masterfrom
chrisd8088 merged 3 commits intomicrosoft:masterfrom
Conversation
Where appropriate, convert functional tests marked MacOnly into POSIXOnly tests which also execute on Linux.
The rename(2) function is identical on Linux and Mac, so update its DllImport wrapper name to POSIXRename() from MacRename() in GVFSLockTests.
The GitStatusReportsSymLinkChanges() functional test will fail on Linux because "ln -s -F" does not have the same meaning as on BSD/Darwin; the -F flag does not imply -f on Linux but instead tries to hard-link a directory. Thus the deletion of the target testFilePath in the test does not occur and the test fails. Instead, we use "ln -s -f" in the CreateSymbolicLink() method in BashRunner which suffices on both types of systems.
Contributor
Author
|
@wilbaker -- This PR now contains just the POSIX-specific bits from #1413 (which has been simplified as a result), as we discussed. And, as a bonus, I found some ways to simplify this set of changes too, so I'm glad I took the time to re-review these. Let me know if you see anything of concern, though! |
This was referenced Sep 24, 2019
wilbaker
approved these changes
Sep 24, 2019
Contributor
Author
|
Thanks for the 👍 @wilbaker!! |
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.
Where appropriate, convert functional tests marked
MacOnlyintoPOSIXOnlytests which also execute on Linux.The
rename(2)function is identical on Linux and Mac, so update itsDllImportwrapper name toPOSIXRename()fromMacRename()inGVFSLockTests.Finally, use generic POSIX options to
ln(1) inBashRunnerbecause theGitStatusReportsSymLinkChanges()functional test will fail on Linux otherwise, asln -s -Fdoes not have the same meaning as on BSD/Darwin; the-Fflag does not imply-fonLinux but instead tries to hard link a directory. Thus the deletion of the target
testFilePathin the test does not occur and the test fails. Instead, we useln -s -fin theCreateSymbolicLink()method inBashRunnerwhich suffices on both types of systems.