diff options
author | 2017-07-25 09:24:56 +0200 | |
---|---|---|
committer | 2017-07-25 13:17:46 +0200 | |
commit | ea23c2b762adec6625f35ea737d0cf63daf6038d (patch) | |
tree | 5bd9963eb65bd139e7e159f713438555a6609b9d /src/test/cpp/blaze_util_test.cc | |
parent | f929b1a174b535ad6e42bf908879996b77060c31 (diff) |
Bazel client: add blaze_util::IsDevNull
Add a method to test if a path is /dev/null (or
case-insensitive "NUL" on Windows), and use it in
blaze::MakeAbsolute.
In this commit:
- implement blaze_util::IsDevNull with POSIX and
Windows semantics + add tests
- blaze::MakeAbsolute calls blaze::ConvertPath
on its input to convert MSYS paths on Windows
- blaze_util::GetCwdW (thus GetCwd) always returns
a lowercase path so that it is deterministic
- blaze_util::GetCurrentDrive returns lowercase
letter to be consisent with blaze::ConvertPath,
which also returns a lowercase path
Fixes https://github.com/bazelbuild/bazel/issues/3440
Change-Id: I3af5ba0a033d542fe64a676d67f27472298d1089
PiperOrigin-RevId: 163038503
Diffstat (limited to 'src/test/cpp/blaze_util_test.cc')
-rw-r--r-- | src/test/cpp/blaze_util_test.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/cpp/blaze_util_test.cc b/src/test/cpp/blaze_util_test.cc index a06e8e0a01..ac3165c642 100644 --- a/src/test/cpp/blaze_util_test.cc +++ b/src/test/cpp/blaze_util_test.cc @@ -264,6 +264,7 @@ TEST_F(BlazeUtilTest, MakeAbsolute) { EXPECT_EQ(MakeAbsolute("foo"), blaze_util::GetCwd() + "/foo"); #endif EXPECT_EQ(MakeAbsolute(std::string()), blaze_util::GetCwd()); + EXPECT_EQ(MakeAbsolute("/dev/null"), "/dev/null"); } } // namespace blaze |