From 22c32b40be54a9e4062655f90908f98b11e73966 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Wed, 17 Jul 2019 03:23:59 -0700 Subject: Add json mapping for command and commandResult. Also exports the fields on these structs so that json can read/write them. BUG=chromium:773875 TEST=unit test Change-Id: I0efead41693dd35548738a0b3a3e5c71c97c319c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1706790 Reviewed-by: George Burgess Tested-by: Tobias Bosch --- compiler_wrapper/print_cmdline_flag_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler_wrapper/print_cmdline_flag_test.go') diff --git a/compiler_wrapper/print_cmdline_flag_test.go b/compiler_wrapper/print_cmdline_flag_test.go index f3ccd723..e42a2b95 100644 --- a/compiler_wrapper/print_cmdline_flag_test.go +++ b/compiler_wrapper/print_cmdline_flag_test.go @@ -37,7 +37,7 @@ func TestPrintNestedCommand(t *testing.T) { func TestPrintCmdWd(t *testing.T) { withTestContext(t, func(ctx *testContext) { printCmd(ctx, &command{ - path: "/somepath", + Path: "/somepath", }) if ctx.stderrString() != fmt.Sprintf("cd '%s' && '/somepath'\n", ctx.tempDir) { t.Errorf("unexpected result. Got: %s", ctx.stderrString()) @@ -48,7 +48,7 @@ func TestPrintCmdWd(t *testing.T) { func TestPrintCmdAbsolutePath(t *testing.T) { withTestContext(t, func(ctx *testContext) { printCmd(ctx, &command{ - path: "somepath", + Path: "somepath", }) if ctx.stderrString() != fmt.Sprintf("cd '%s' && '%s/somepath'\n", ctx.tempDir, ctx.tempDir) { t.Errorf("unexpected result. Got: %s", ctx.stderrString()) @@ -59,8 +59,8 @@ func TestPrintCmdAbsolutePath(t *testing.T) { func TestPrintCmdEnvUpdates(t *testing.T) { withTestContext(t, func(ctx *testContext) { printCmd(ctx, &command{ - path: "/somepath", - envUpdates: []string{"a=b"}, + Path: "/somepath", + EnvUpdates: []string{"a=b"}, }) if ctx.stderrString() != fmt.Sprintf("cd '%s' && env 'a=b' '/somepath'\n", ctx.tempDir) { t.Errorf("unexpected result. Got: %s", ctx.stderrString()) @@ -71,8 +71,8 @@ func TestPrintCmdEnvUpdates(t *testing.T) { func TestPrintCmdArgs(t *testing.T) { withTestContext(t, func(ctx *testContext) { printCmd(ctx, &command{ - path: "/somepath", - args: []string{"-a"}, + Path: "/somepath", + Args: []string{"-a"}, }) if ctx.stderrString() != fmt.Sprintf("cd '%s' && '/somepath' '-a'\n", ctx.tempDir) { t.Errorf("unexpected result. Got: %s", ctx.stderrString()) -- cgit v1.2.3