Bazel client: add and use blaze::GetPathEnv()
Use GetPathEnv() instead of GetEnv() for envvars
with paths.
On Linux/macOS/POSIX, GetPathEnv and GetEnv do the
same.
On Windows, GetPathEnv removes the UNC prefix from
the result, calls AsWindowsPath, then converts
backslashes to forward slashes. (As callers expect
the result.)
Fixes https://github.com/bazelbuild/bazel/issues/7705
Closes #7707.
PiperOrigin-RevId: 238236143
diff --git a/src/test/cpp/workspace_layout_test.cc b/src/test/cpp/workspace_layout_test.cc
index 4e17d64..865005a 100644
--- a/src/test/cpp/workspace_layout_test.cc
+++ b/src/test/cpp/workspace_layout_test.cc
@@ -27,10 +27,10 @@
class WorkspaceLayoutTest : public ::testing::Test {
protected:
- WorkspaceLayoutTest() :
- build_root_(blaze_util::JoinPath(
- blaze::GetEnv("TEST_TMPDIR"), "build_root")),
- workspace_layout_(new WorkspaceLayout()) {}
+ WorkspaceLayoutTest()
+ : build_root_(blaze_util::JoinPath(blaze::GetPathEnv("TEST_TMPDIR"),
+ "build_root")),
+ workspace_layout_(new WorkspaceLayout()) {}
void SetUp() override {
ASSERT_TRUE(blaze_util::MakeDirectories(build_root_, 0755));