diff options
author | Tobias Bosch <tbosch@google.com> | 2019-07-13 05:32:22 -0700 |
---|---|---|
committer | Tobias Bosch <tbosch@google.com> | 2019-07-18 08:22:42 +0000 |
commit | 0fc0acdd69e58273ba8987cba9afac2304454561 (patch) | |
tree | 1a1e31d90aaca511fbc2f46d473c74097c2587cf /compiler_wrapper | |
parent | 38999a578f1b6942eac771f3fb6ca6bd4930dfdb (diff) | |
download | toolchain-utils-0fc0acdd69e58273ba8987cba9afac2304454561.tar.gz |
Remove unused code
BUG=chromium:773875
TEST=unit test
Change-Id: I83b134aaf559f178834381a1178e287659be2ac1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1702632
Reviewed-by: George Burgess <gbiv@chromium.org>
Tested-by: Tobias Bosch <tbosch@google.com>
Diffstat (limited to 'compiler_wrapper')
-rw-r--r-- | compiler_wrapper/oldwrapper.go | 5 | ||||
-rw-r--r-- | compiler_wrapper/oldwrapper_test.go | 10 | ||||
-rw-r--r-- | compiler_wrapper/testutil_test.go | 9 |
3 files changed, 0 insertions, 24 deletions
diff --git a/compiler_wrapper/oldwrapper.go b/compiler_wrapper/oldwrapper.go index f2aebed3..514c413a 100644 --- a/compiler_wrapper/oldwrapper.go +++ b/compiler_wrapper/oldwrapper.go @@ -14,7 +14,6 @@ import ( "text/template" ) -const forwardToOldWrapperFilePattern = "old_wrapper_forward" const compareToOldWrapperFilePattern = "old_wrapper_compare" func compareToOldWrapper(env env, cfg *config, inputCmd *command, newCmdResults []*commandResult, newExitCode int) error { @@ -22,7 +21,6 @@ func compareToOldWrapper(env env, cfg *config, inputCmd *command, newCmdResults if err != nil { return err } - oldWrapperCfg.LogCmds = true oldWrapperCfg.MockCmds = cfg.mockOldWrapperCmds newCmds := []*command{} for _, cmdResult := range newCmdResults { @@ -157,7 +155,6 @@ type oldWrapperConfig struct { CmdPath string OldWrapperContent string RootRelPath string - LogCmds bool MockCmds bool CmdResults []oldWrapperCmdResult OverwriteConfig bool @@ -222,11 +219,9 @@ mockResults = [{{range .CmdResults}} { },{{end}}] def serialize_cmd(args): - {{if .LogCmds}} current_env = os.environ envupdate = [k + "=" + current_env.get(k, '') for k in set(list(current_env.keys()) + list(init_env.keys())) if current_env.get(k, '') != init_env.get(k, '')] print('command:%s.EnvUpdate:%s' % (' '.join(args), ' '.join(envupdate)), file=sys.stderr) - {{end}} def check_output_mock(args): serialize_cmd(args) diff --git a/compiler_wrapper/oldwrapper_test.go b/compiler_wrapper/oldwrapper_test.go index d981d0a9..f8432b11 100644 --- a/compiler_wrapper/oldwrapper_test.go +++ b/compiler_wrapper/oldwrapper_test.go @@ -143,16 +143,6 @@ func TestCompareToOldWrapperNestedCommand(t *testing.T) { }) } -func withForwardToOldWrapperTestContext(t *testing.T, work func(ctx *testContext)) { - withTestContext(t, func(ctx *testContext) { - // Need to make sure the old wrapper file exists as oldwrapper.go - // tries to read it. - ctx.cfg.oldWrapperPath = filepath.Join(ctx.tempDir, "somewrapper") - ctx.writeFile(ctx.cfg.oldWrapperPath, "") - work(ctx) - }) -} - func writeMockWrapper(ctx *testContext, cfg *mockWrapperConfig) { const mockTemplate = ` from __future__ import print_function diff --git a/compiler_wrapper/testutil_test.go b/compiler_wrapper/testutil_test.go index 06ec934d..6a9557ff 100644 --- a/compiler_wrapper/testutil_test.go +++ b/compiler_wrapper/testutil_test.go @@ -282,15 +282,6 @@ func newExitCodeError(exitCode int) error { return tmpCmd.Run() } -func isForwardToOldWrapperCmd(cmd *command) bool { - for _, arg := range cmd.args { - if strings.Contains(arg, forwardToOldWrapperFilePattern) { - return true - } - } - return false -} - func isCompareToOldWrapperCmd(cmd *command) bool { for _, arg := range cmd.args { if strings.Contains(arg, compareToOldWrapperFilePattern) { |