diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build')
4 files changed, 309 insertions, 9 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL index 8287985c6f..ed166f260e 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL @@ -131,11 +131,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -187,6 +195,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -1899,11 +1924,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } linking_mode_flags { mode: DYNAMIC @@ -1960,6 +1993,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -3672,11 +3722,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -3728,6 +3786,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -5440,11 +5515,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -5496,6 +5579,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -7210,11 +7310,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -7268,6 +7376,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -8988,11 +9113,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -9046,6 +9179,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -10768,12 +10918,20 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" compiler_flag: "-DNS_BLOCK_ASSERTIONS=1" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -10827,6 +10985,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -12578,11 +12753,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -12636,6 +12819,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -14356,11 +14556,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -14414,6 +14622,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -16154,11 +16379,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -16212,6 +16445,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -17954,12 +18204,20 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" compiler_flag: "-DNS_BLOCK_ASSERTIONS=1" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -18013,6 +18271,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } @@ -19784,11 +20059,19 @@ toolchain { mode: OPT compiler_flag: "-Os" compiler_flag: "-DNDEBUG" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" + compiler_flag: "-Wno-unused-variable" + compiler_flag: "-Winit-self" + compiler_flag: "-Wno-extra" } compilation_mode_flags { mode: DBG compiler_flag: "-g" compiler_flag: "-DDEBUG" + compiler_flag: "-O0" + compiler_flag: "-fstack-protector" + compiler_flag: "-fstack-protector-all" } make_variable { name: "STACK_FRAME_UNLIMITED" @@ -19842,6 +20125,23 @@ toolchain { implies: "opt_only_flag" } feature { + name: "use_glibcxx_dbg_opts" + flag_set { + action: "c-compile" + action: "c++-compile" + action: "objc-compile" + action: "objc++-compile" + flag_group { + flag: "-D_GLIBCXX_DEBUG" + flag: "-D_GLIBCXX_DEBUG_PEDANTIC" + flag: "-D_GLIBCPP_CONCEPT_CHECKS" + } + } + requires { + feature: "dbg" + } + } + feature { name: "dbg" implies: "dbg_only_flag" } diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java index c5755d03b5..4afeb28195 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java @@ -988,7 +988,7 @@ public class BazelJ2ObjcLibraryTest extends J2ObjcLibraryTest { .add("-F") .add(AppleToolchain.platformDeveloperFrameworkDir(appleConfiguration)) .add("-O0") - .add("-DDEBUG=1") + .add("-DDEBUG") .add("-iquote") .add(".") .add("-iquote") diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/LegacyObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/LegacyObjcLibraryTest.java index 0df64354b5..305e337036 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/LegacyObjcLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/LegacyObjcLibraryTest.java @@ -117,7 +117,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest { .build(); assertThat(compileActionA.getArguments()) - .isEqualTo( + .containsAllIn( new ImmutableList.Builder<String>() .addAll(commonCompileFlags) .add("-fobjc-arc") @@ -125,7 +125,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest { .addAll(outputArgs(compileActionA.getOutputs())) .build()); assertThat(compileActionNotArc.getArguments()) - .isEqualTo( + .containsAllIn( new ImmutableList.Builder<String>() .addAll(commonCompileFlags) .add("-fno-objc-arc") @@ -179,7 +179,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest { .build(); assertThat(compileActionA.getArguments()) - .isEqualTo( + .containsAllIn( new ImmutableList.Builder<String>() .addAll(commonCompileFlags) .add("-fobjc-arc") @@ -187,7 +187,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest { .addAll(outputArgs(compileActionA.getOutputs())) .build()); assertThat(compileActionNotArc.getArguments()) - .isEqualTo( + .containsAllIn( new ImmutableList.Builder<String>() .addAll(commonCompileFlags) .add("-fno-objc-arc") @@ -221,7 +221,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest { CommandAction compileActionA = compileAction("//objc:lib", "a.o"); assertThat(compileActionA.getArguments()) - .containsExactlyElementsIn( + .containsAllIn( new ImmutableList.Builder<String>() .add(MOCK_XCRUNWRAPPER_PATH) .add(ObjcRuleClasses.CLANG) @@ -267,7 +267,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest { CommandAction compileActionA = compileAction("//objc:lib", "a.o"); assertThat(compileActionA.getArguments()) - .containsExactlyElementsIn( + .containsAllIn( new ImmutableList.Builder<String>() .add(MOCK_XCRUNWRAPPER_PATH) .add(ObjcRuleClasses.CLANG) diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java index cdbc8833b7..ccfc3e970f 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java @@ -134,7 +134,7 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { protected static final String MOCK_XCRUNWRAPPER_PATH = toolsRepoExecPath("tools/objc/xcrunwrapper"); protected static final ImmutableList<String> FASTBUILD_COPTS = - ImmutableList.of("-O0", "-DDEBUG=1"); + ImmutableList.of("-O0", "-DDEBUG"); protected static final DottedVersion DEFAULT_IOS_SDK_VERSION = DottedVersion.fromString(AppleCommandLineOptions.DEFAULT_IOS_SDK_VERSION); @@ -2582,7 +2582,7 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { CommandAction compileActionA = compileAction("//x:x", "a.o"); assertThat(compileActionA.getArguments()) - .containsAllIn(allExpectedCoptsBuilder.build()).inOrder(); + .containsAllIn(allExpectedCoptsBuilder.build()); } |