aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/disable_werror_flag_test.go
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2021-01-25 12:11:56 -0800
committerGeorge Burgess <gbiv@chromium.org>2021-01-29 17:39:12 +0000
commit8126715006b533888697689276b771cf6cdc2063 (patch)
tree7f8273650dd0fb798b199a52882b885df2860917 /compiler_wrapper/disable_werror_flag_test.go
parent77a0c2073a603ce6698f3667036e62a572cbb37c (diff)
downloadtoolchain-utils-8126715006b533888697689276b771cf6cdc2063.tar.gz
compiler_wrapper: disable force-disable-werror with GCC
Enabling this functionality with GCC is pointless -- we don't roll it, so we don't want to catch new -Werrors with it. We're having some GCC-specific functionality coming in soon; disabling this simplifies things some. BUG=chromium:1166017 TEST=CQ Change-Id: I3f73a8124ea85a2f14fd5c909a9bbed2b46f28f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2648431 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-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.go30
1 files changed, 27 insertions, 3 deletions
diff --git a/compiler_wrapper/disable_werror_flag_test.go b/compiler_wrapper/disable_werror_flag_test.go
index 0c43dbe0..d0054262 100644
--- a/compiler_wrapper/disable_werror_flag_test.go
+++ b/compiler_wrapper/disable_werror_flag_test.go
@@ -412,13 +412,21 @@ func TestAndroidDisableWerror(t *testing.T) {
// Disable werror ON
ctx.cfg.useLlvmNext = true
- if !shouldForceDisableWerror(ctx, ctx.cfg) {
+ if !shouldForceDisableWerror(ctx, ctx.cfg, gccType) {
+ t.Errorf("disable Werror not enabled for Android with useLlvmNext")
+ }
+
+ if !shouldForceDisableWerror(ctx, ctx.cfg, clangType) {
t.Errorf("disable Werror not enabled for Android with useLlvmNext")
}
// Disable werror OFF
ctx.cfg.useLlvmNext = false
- if shouldForceDisableWerror(ctx, ctx.cfg) {
+ if shouldForceDisableWerror(ctx, ctx.cfg, gccType) {
+ t.Errorf("disable-Werror enabled for Android without useLlvmNext")
+ }
+
+ if shouldForceDisableWerror(ctx, ctx.cfg, clangType) {
t.Errorf("disable-Werror enabled for Android without useLlvmNext")
}
})
@@ -426,12 +434,28 @@ func TestAndroidDisableWerror(t *testing.T) {
func TestChromeOSNoForceDisableWerror(t *testing.T) {
withTestContext(t, func(ctx *testContext) {
- if shouldForceDisableWerror(ctx, ctx.cfg) {
+ if shouldForceDisableWerror(ctx, ctx.cfg, gccType) {
+ t.Errorf("disable Werror enabled for ChromeOS without FORCE_DISABLE_WERROR set")
+ }
+
+ if shouldForceDisableWerror(ctx, ctx.cfg, clangType) {
t.Errorf("disable Werror enabled for ChromeOS without FORCE_DISABLE_WERROR set")
}
})
}
+func TestChromeOSForceDisableWerrorOnlyAppliesToClang(t *testing.T) {
+ withForceDisableWErrorTestContext(t, func(ctx *testContext) {
+ if !shouldForceDisableWerror(ctx, ctx.cfg, clangType) {
+ t.Errorf("Disable -Werror should be enabled for clang.")
+ }
+
+ if shouldForceDisableWerror(ctx, ctx.cfg, gccType) {
+ t.Errorf("Disable -Werror should be disabled for gcc.")
+ }
+ })
+}
+
func TestClangTidyNoDoubleBuild(t *testing.T) {
withTestContext(t, func(ctx *testContext) {
ctx.cfg.isAndroidWrapper = true