aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/testutil_test.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-10-28 14:26:51 -0700
committerTobias Bosch <tbosch@google.com>2019-11-01 00:05:45 +0000
commit8dd67e1063927b99ee18caa11ccee9abc1c0cbd1 (patch)
treec4a14c61db6294de2b58ab1b7b09d28c656fc047 /compiler_wrapper/testutil_test.go
parentb922860193acc4c2f5c9ae28e29f0f33deffcd1b (diff)
downloadtoolchain-utils-8dd67e1063927b99ee18caa11ccee9abc1c0cbd1.tar.gz
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 <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
Diffstat (limited to 'compiler_wrapper/testutil_test.go')
-rw-r--r--compiler_wrapper/testutil_test.go43
1 files changed, 0 insertions, 43 deletions
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
-}