diff options
Diffstat (limited to 'compiler_wrapper/sysroot_flag_test.go')
-rw-r--r-- | compiler_wrapper/sysroot_flag_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler_wrapper/sysroot_flag_test.go b/compiler_wrapper/sysroot_flag_test.go index 1c757276..308d5e96 100644 --- a/compiler_wrapper/sysroot_flag_test.go +++ b/compiler_wrapper/sysroot_flag_test.go @@ -32,12 +32,29 @@ func TestSetSysrootFlagFromEnv(t *testing.T) { ctx.env = []string{"SYSROOT=/envpath"} cmd := ctx.must(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) + if err := verifyEnvUpdate(cmd, "SYSROOT="); err != nil { + t.Error(err) + } if err := verifyArgOrder(cmd, "--sysroot=/envpath", mainCc); err != nil { t.Error(err) } }) } +func TestClearEmptySysrootFlagInEnv(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + ctx.env = []string{"SYSROOT="} + cmd := ctx.must(callCompiler(ctx, ctx.cfg, + ctx.newCommand(gccX86_64, mainCc))) + if err := verifyEnvUpdate(cmd, "SYSROOT="); err != nil { + t.Error(err) + } + if err := verifyArgOrder(cmd, "--sysroot=.*/x86_64-cros-linux-gnu", mainCc); err != nil { + t.Error(err) + } + }) +} + func TestSetSysrootRelativeToWrapperPath(t *testing.T) { withTestContext(t, func(ctx *testContext) { ctx.cfg.rootRelPath = "somepath" |