aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/cros_hardened_config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'compiler_wrapper/cros_hardened_config_test.go')
-rw-r--r--compiler_wrapper/cros_hardened_config_test.go27
1 files changed, 16 insertions, 11 deletions
diff --git a/compiler_wrapper/cros_hardened_config_test.go b/compiler_wrapper/cros_hardened_config_test.go
index 337b27fe..b459f1e2 100644
--- a/compiler_wrapper/cros_hardened_config_test.go
+++ b/compiler_wrapper/cros_hardened_config_test.go
@@ -16,15 +16,8 @@ const crosHardenedGoldenDir = "testdata/cros_hardened_golden"
const crosHardenedNoCCacheGoldenDir = "testdata/cros_hardened_noccache_golden"
const crosHardenedLlvmNextGoldenDir = "testdata/cros_hardened_llvmnext_golden"
-func withGoldenTestContext(t *testing.T, f func(ctx *testContext)) {
- withTestContext(t, func(ctx *testContext) {
- ctx.NoteTestWritesToUmask()
- f(ctx)
- })
-}
-
func TestCrosHardenedConfig(t *testing.T) {
- withGoldenTestContext(t, func(ctx *testContext) {
+ withTestContext(t, func(ctx *testContext) {
useLlvmNext := false
useCCache := true
cfg, err := getConfig("cros.hardened", useCCache, useLlvmNext, "123")
@@ -38,7 +31,7 @@ func TestCrosHardenedConfig(t *testing.T) {
}
func TestCrosHardenedConfigWithoutCCache(t *testing.T) {
- withGoldenTestContext(t, func(ctx *testContext) {
+ withTestContext(t, func(ctx *testContext) {
useLlvmNext := false
useCCache := false
cfg, err := getConfig("cros.hardened", useCCache, useLlvmNext, "123")
@@ -63,7 +56,7 @@ func TestCrosHardenedConfigWithoutCCache(t *testing.T) {
}
func TestCrosHardenedConfigWithLlvmNext(t *testing.T) {
- withGoldenTestContext(t, func(ctx *testContext) {
+ withTestContext(t, func(ctx *testContext) {
useLlvmNext := true
useCCache := true
cfg, err := getConfig("cros.hardened", useCCache, useLlvmNext, "123")
@@ -524,7 +517,7 @@ func createClangArgsGoldenInputs() goldenFile {
Name: "clang_specific_args.json",
Records: []goldenRecord{
{
- WrapperCmd: newGoldenCmd(clangX86_64, "-mno-movbe", "-Wclobbered", "-Wno-psabi", "-Wlogical-op",
+ WrapperCmd: newGoldenCmd(clangX86_64, "-mno-movbe", "-pass-exit-codes", "-Wclobbered", "-Wno-psabi", "-Wlogical-op",
"-Wmissing-parameter-type", "-Wold-style-declaration", "-Woverride-init", "-Wunsafe-loop-optimizations",
"-Wstrict-aliasing=abc", "-finline-limit=abc", mainCc),
Cmds: okResults,
@@ -538,6 +531,18 @@ func createClangArgsGoldenInputs() goldenFile {
Cmds: okResults,
},
{
+ WrapperCmd: newGoldenCmd(clangX86_64, "-Wno-error=unused-but-set-variable", mainCc),
+ Cmds: okResults,
+ },
+ {
+ WrapperCmd: newGoldenCmd(clangX86_64, "-Wno-unused-but-set-variable", mainCc),
+ Cmds: okResults,
+ },
+ {
+ WrapperCmd: newGoldenCmd(clangX86_64, "-Wunused-but-set-variable", mainCc),
+ Cmds: okResults,
+ },
+ {
WrapperCmd: newGoldenCmd(clangX86_64, "-Xclang-only=-someflag", mainCc),
Cmds: okResults,
},