Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crossplatform tests that cause Path.GetFullPath to throw #637

Closed
cdmihai opened this issue May 19, 2016 · 5 comments
Closed

Add crossplatform tests that cause Path.GetFullPath to throw #637

cdmihai opened this issue May 19, 2016 · 5 comments
Labels
CoreCLR-test help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. triaged xplat

Comments

@cdmihai
Copy link
Contributor

cdmihai commented May 19, 2016

With PR #632, we are swapping out MSBuild's implementation of Path.GetFullPath with the one in .net.

More tests are needed that cause Path.GetFullPath to throw an exception on Linux and OSX, when the method is called from an item function. The current tests for this scenario are windows only: #632 (diff). Since Unix paths accept everything but / and /0, it might be tricky to make it fail. Maybe take away file permissions?

@cdmihai cdmihai added help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. CoreCLR-test xplat labels May 19, 2016
@rainersigwald
Copy link
Member

HFS+ (OS X) paths disallow :, so there's a test case. For Linux paths maybe this is meaningless.

@cdmihai
Copy link
Contributor Author

cdmihai commented May 19, 2016

On OSX I just tried touch a:b and it created the file. echo "hello" > a:b also works
Don't know what .Net Core actually does.

@radical
Copy link
Member

radical commented May 19, 2016

We have some tests here. Look for GetFullPath* .

@coderpatros
Copy link
Contributor

I take it no one is working on this already?

The tests @radical reference target all platforms within the same unit test. The tests I've seen in msbuild code have platform specific unit tests when required. Can anyone give me some guidance on the preferred approach before I start porting the tests over?

@cdmihai
Copy link
Contributor Author

cdmihai commented Jun 20, 2017

Go ahead and remove the PlatformSpecific part, and switch the minimum test data based based on the OS, at the beginning of the tests. You don't have to port verbatim, because we're not testing Path.GetFullPath. Just the tests exercising msbuild item functions from #632 (diff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CoreCLR-test help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. triaged xplat
Projects
None yet
Development

No branches or pull requests

6 participants