aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/disable_werror_flag_test.go
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2020-06-09 21:33:44 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-11 02:02:42 +0000
commita87b84fe8c7aa5f497c5785ddc4778344f283e4e (patch)
tree6f0972e060e8074bd1ce7bbbab31d78b13fb6578 /compiler_wrapper/disable_werror_flag_test.go
parentad5bd3e097f1d6ef592bdbc5ee041ad896b6b9aa (diff)
downloadtoolchain-utils-a87b84fe8c7aa5f497c5785ddc4778344f283e4e.tar.gz
[android wrapper] Write warning report to stdout on Android
Write the warning report to stdout (surrounded by a tag <LLVM_NEXT_ERROR_REPORT>). Currently OUT_DIR only gets passed to local compiles, and so remote compiles can't do the double build. Even if they write to /tmp, RBE or Goma won't know to copy them as part of the output. Packaging the warnings reports is a problem as well since the additional build step needs extra surgery in soong (it's not possible to add a dangling, optional build step in Ninja). Writing the reports to stdout conveniently solves both these issues. We can just scrape the reports with a script. Originall reviewed at https://android-review.googlesource.com/c/platform/external/toolchain-utils/+/1328433/2. BUG=None TEST=build master with r391452 and check progress past new errors. Change-Id: I5f1f71faba002836067a82f6aa4b26d5ba8b7b99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2239371 Commit-Queue: Pirama Arumuga Nainar <pirama@google.com> Tested-by: Pirama Arumuga Nainar <pirama@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/disable_werror_flag_test.go')
-rw-r--r--compiler_wrapper/disable_werror_flag_test.go34
1 files changed, 8 insertions, 26 deletions
diff --git a/compiler_wrapper/disable_werror_flag_test.go b/compiler_wrapper/disable_werror_flag_test.go
index 28e48371..ecc1090b 100644
--- a/compiler_wrapper/disable_werror_flag_test.go
+++ b/compiler_wrapper/disable_werror_flag_test.go
@@ -11,7 +11,6 @@ import (
"io"
"io/ioutil"
"os"
- "path"
"path/filepath"
"strings"
"testing"
@@ -407,45 +406,28 @@ func TestDoubleBuildWerrorChmodsThingsAppropriately(t *testing.T) {
})
}
-func TestAndroidGetNewWarningsDir(t *testing.T) {
+func TestAndroidDisableWerror(t *testing.T) {
withTestContext(t, func(ctx *testContext) {
- outDir := "/foo/bar"
- expectedDir := path.Join(outDir, "warnings_reports")
-
- ctx.env = []string{"OUT_DIR=" + outDir}
ctx.cfg.isAndroidWrapper = true
// Disable werror ON
ctx.cfg.useLlvmNext = true
- dir, ok := getNewWarningsDir(ctx, ctx.cfg)
- if !ok || dir != expectedDir {
- t.Errorf("disable Werror not enabled for Android with useLlvmNext (dirName=%q ok=%t), expectedDir=%q", dir, ok, expectedDir)
+ if !shouldForceDisableWerror(ctx, ctx.cfg) {
+ t.Errorf("disable Werror not enabled for Android with useLlvmNext")
}
// Disable werror OFF
ctx.cfg.useLlvmNext = false
- dir, ok = getNewWarningsDir(ctx, ctx.cfg)
- if ok || dir != "" {
- t.Errorf("disable Werror incorrectly enabled for Android without useLlvmNext (dirName=%q ok=%t)", dir, ok)
+ if shouldForceDisableWerror(ctx, ctx.cfg) {
+ t.Errorf("disable-Werror enabled for Android without useLlvmNext")
}
})
}
-func TestChromeOSGetNewWarningsDirOn(t *testing.T) {
- withForceDisableWErrorTestContext(t, func(ctx *testContext) {
- dir, ok := getNewWarningsDir(ctx, ctx.cfg)
- if !ok || dir != ctx.cfg.newWarningsDir {
- t.Errorf("disable Werror not enabled for ChromeOS with FORCE_DISABLE_WERROR set (dirName=%q ok=%t) expectedDir=%q", dir, ok, ctx.cfg.newWarningsDir)
- }
-
- })
-}
-
-func TestChromeOSGetNewWarningsDirOff(t *testing.T) {
+func TestChromeOSNoForceDisableWerror(t *testing.T) {
withTestContext(t, func(ctx *testContext) {
- dir, ok := getNewWarningsDir(ctx, ctx.cfg)
- if ok || dir != "" {
- t.Errorf("disable Werror incorrectly enabled for ChromeOS without FORCE_DISABLE_WERROR set (dirName=%q ok=%t)", dir, ok)
+ if shouldForceDisableWerror(ctx, ctx.cfg) {
+ t.Errorf("disable Werror enabled for ChromeOS without FORCE_DISABLE_WERROR set")
}
})
}