aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/bisect_flag_test.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-10-11 11:26:36 -0700
committerManoj Gupta <manojgupta@chromium.org>2019-10-11 18:56:28 +0000
commit6ecb3475254b6ab7ab3be6a2f58abc2f2fdd3da8 (patch)
tree73874c62dcf685c5f28989db135ea19984b2c09d /compiler_wrapper/bisect_flag_test.go
parentf40d1b4761c07826176d3075148ee21ce75da465 (diff)
downloadtoolchain-utils-6ecb3475254b6ab7ab3be6a2f58abc2f2fdd3da8.tar.gz
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 <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tobias Bosch <tbosch@google.com> Tested-by: Manoj Gupta <manojgupta@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Diffstat (limited to 'compiler_wrapper/bisect_flag_test.go')
-rw-r--r--compiler_wrapper/bisect_flag_test.go5
1 files changed, 2 insertions, 3 deletions
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)
}
})