diff options
author | Tobias Bosch <tbosch@google.com> | 2019-07-10 06:16:04 -0700 |
---|---|---|
committer | Tobias Bosch <tbosch@google.com> | 2019-07-11 08:28:44 +0000 |
commit | 9d60930e882d0e39b48e6dfab0bffa12f6f544ee (patch) | |
tree | d391ca536e9371ee9c7431f0f195a88c42ae47c8 /compiler_wrapper/compiler_wrapper_test.go | |
parent | 9332d21c19199f99886b1476cab6f4dd89e82a72 (diff) | |
download | toolchain-utils-9d60930e882d0e39b48e6dfab0bffa12f6f544ee.tar.gz |
Support resource usage logging
BUG=chromium:773875
TEST=unit test
Change-Id: Ifc0a7311b439e767dbb83bee350c210abbff54e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1695802
Reviewed-by: Tobias Bosch <tbosch@google.com>
Tested-by: Tobias Bosch <tbosch@google.com>
Diffstat (limited to 'compiler_wrapper/compiler_wrapper_test.go')
-rw-r--r-- | compiler_wrapper/compiler_wrapper_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler_wrapper/compiler_wrapper_test.go b/compiler_wrapper/compiler_wrapper_test.go index 5abf7ce9..0a041fe8 100644 --- a/compiler_wrapper/compiler_wrapper_test.go +++ b/compiler_wrapper/compiler_wrapper_test.go @@ -124,6 +124,19 @@ func TestLogExitCodeErrorWhenComparingToOldWrapper(t *testing.T) { }) } +func TestErrorOnLogRusageAndForceDisableWError(t *testing.T) { + withTestContext(t, func(ctx *testContext) { + ctx.env = []string{ + "FORCE_DISABLE_WERROR=1", + "GETRUSAGE=" + filepath.Join(ctx.tempDir, "rusage.log"), + } + stderr := ctx.mustFail(callCompiler(ctx, ctx.cfg, ctx.newCommand(gccX86_64, mainCc))) + if err := verifyNonInternalError(stderr, "GETRUSAGE is meaningless with FORCE_DISABLE_WERROR"); err != nil { + t.Error(err) + } + }) +} + func TestPrintUserCompilerError(t *testing.T) { buffer := bytes.Buffer{} printCompilerError(&buffer, newUserErrorf("abcd")) |