From 8dd67e1063927b99ee18caa11ccee9abc1c0cbd1 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 28 Oct 2019 14:26:51 -0700 Subject: toolchain_utils: Remove comparison to old wrapper from compiler_wrapper. BUG=chromium:773875 TEST='go test' passes Change-Id: Iecbe15067bf37fd86fbb8a907d42df32288821d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1884701 Reviewed-by: George Burgess Tested-by: Tobias Bosch --- compiler_wrapper/testutil_test.go | 43 --------------------------------------- 1 file changed, 43 deletions(-) (limited to 'compiler_wrapper/testutil_test.go') diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go index c0e49fdd..57a68df2 100644 --- a/compiler_wrapper/testutil_test.go +++ b/compiler_wrapper/testutil_test.go @@ -6,7 +6,6 @@ package main import ( "bytes" - "flag" "fmt" "io" "io/ioutil" @@ -18,9 +17,6 @@ import ( "testing" ) -var crosRootDirFlag = flag.String("crosroot", "", "root dir of the chrome os toolchain") -var androidPrebuiltsDirFlag = flag.String("androidprebuilts", "", "prebuilts dir of android") - const mainCc = "main.cc" const clangAndroid = "./clang" const clangX86_64 = "./x86_64-cros-linux-gnu-clang" @@ -107,22 +103,6 @@ func (ctx *testContext) stderrString() string { } func (ctx *testContext) run(cmd *command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error { - // Keep calling the old wrapper when we are comparing the output of the - // old wrapper to the new wrapper. - if isCompareToOldWrapperCmd(cmd) { - // Make sure we have a PATH in the env as the old wrapper needs that. - pathFound := false - for _, arg := range ctx.env { - if arg == "PATH" { - pathFound = true - break - } - } - if !pathFound { - ctx.env = append(ctx.env, "PATH=") - } - return runCmd(ctx, cmd, nil, stdout, stderr) - } ctx.cmdCount++ ctx.lastCmd = cmd if ctx.cmdMock != nil { @@ -157,21 +137,7 @@ func (ctx *testContext) mustFail(exitCode int) string { func (ctx *testContext) updateConfig(cfg *config) { *ctx.cfg = *cfg - ctx.cfg.mockOldWrapperCmds = true ctx.cfg.newWarningsDir = filepath.Join(ctx.tempDir, "fatal_clang_warnings") - if strings.HasPrefix(ctx.cfg.oldWrapperPath, "$CHROOT") { - if *crosRootDirFlag != "" && ctx.cfg.oldWrapperPath != "" { - ctx.cfg.oldWrapperPath = strings.Replace(ctx.cfg.oldWrapperPath, "$CHROOT", *crosRootDirFlag, -1) - } else { - ctx.cfg.oldWrapperPath = "" - } - } else if strings.HasPrefix(ctx.cfg.oldWrapperPath, "$ANDROID_PREBUILTS") { - if *androidPrebuiltsDirFlag != "" && ctx.cfg.oldWrapperPath != "" { - ctx.cfg.oldWrapperPath = strings.Replace(ctx.cfg.oldWrapperPath, "$ANDROID_PREBUILTS", *androidPrebuiltsDirFlag, -1) - } else { - ctx.cfg.oldWrapperPath = "" - } - } } func (ctx *testContext) newCommand(path string, args ...string) *command { @@ -325,12 +291,3 @@ func newExitCodeError(exitCode int) error { tmpCmd := exec.Command("/bin/sh", "-c", fmt.Sprintf("exit %d", exitCode)) return tmpCmd.Run() } - -func isCompareToOldWrapperCmd(cmd *command) bool { - for _, arg := range cmd.Args { - if strings.Contains(arg, compareToOldWrapperFilePattern) { - return true - } - } - return false -} -- cgit v1.2.3