From 6ecb3475254b6ab7ab3be6a2f58abc2f2fdd3da8 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 11 Oct 2019 11:26:36 -0700 Subject: compiler_wrapper: Replace UserHomeDir uses. os.UserHomeDir is not available in the Go version in Cros SDK. Replace by explicit env value of "HOME". BUG=None TEST=go test Change-Id: Ia0da2d9bce042510fcc1b14cb074dadfe4d0f2f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1856381 Commit-Queue: Manoj Gupta Reviewed-by: George Burgess Reviewed-by: Tobias Bosch Tested-by: Manoj Gupta Legacy-Commit-Queue: Commit Bot --- compiler_wrapper/bisect_flag_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler_wrapper/bisect_flag_test.go') diff --git a/compiler_wrapper/bisect_flag_test.go b/compiler_wrapper/bisect_flag_test.go index 43c3095b..8500eef2 100644 --- a/compiler_wrapper/bisect_flag_test.go +++ b/compiler_wrapper/bisect_flag_test.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io" - "os" "path/filepath" "strings" "testing" @@ -83,12 +82,12 @@ func TestDefaultBisectDirAndroid(t *testing.T) { withBisectTestContext(t, func(ctx *testContext) { ctx.env = []string{ "BISECT_STAGE=someBisectStage", + "HOME=/somehome", } ctx.cfg.isAndroidWrapper = true cmd := mustCallBisectDriver(ctx, callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) - userHome, _ := os.UserHomeDir() if err := verifyArgOrder(cmd, - "someBisectStage", filepath.Join(userHome, "ANDROID_BISECT")); err != nil { + "someBisectStage", filepath.Join("/somehome", "ANDROID_BISECT")); err != nil { t.Error(err) } }) -- cgit v1.2.3