aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar twerth <twerth@google.com>2017-10-24 13:12:13 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-10-24 14:59:32 +0200
commit5f5e2b471cef3fdb5e4998c7947cbd657305a48f (patch)
tree0e304834a08c9d9ae997d77cc9ee9a4d3574f9ba /src/test/java/com/google/devtools
parent7414b873105a2e0435267d5b863caa7df0d57e38 (diff)
Automated rollback of commit e9b10399f6a148a3d20442f2c5020b05fa891873.
*** Reason for rollback *** Breaks ~2k ios targets, see b/68179560 *** Original change description *** Move hard-coded compilation-mode-specific flags in ObjcConfiguration. PiperOrigin-RevId: 173239463
Diffstat (limited to 'src/test/java/com/google/devtools')
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL300
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/objc/BazelJ2ObjcLibraryTest.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/objc/LegacyObjcLibraryTest.java12
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java4
4 files changed, 9 insertions, 309 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 ed166f260e..8287985c6f 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,19 +131,11 @@ 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"
@@ -195,23 +187,6 @@ 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"
}
@@ -1924,19 +1899,11 @@ 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
@@ -1993,23 +1960,6 @@ 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"
}
@@ -3722,19 +3672,11 @@ 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"
@@ -3786,23 +3728,6 @@ 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"
}
@@ -5515,19 +5440,11 @@ 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"
@@ -5579,23 +5496,6 @@ 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"
}
@@ -7310,19 +7210,11 @@ 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"
@@ -7376,23 +7268,6 @@ 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"
}
@@ -9113,19 +8988,11 @@ 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"
@@ -9179,23 +9046,6 @@ 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"
}
@@ -10918,20 +10768,12 @@ 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"
@@ -10985,23 +10827,6 @@ 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"
}
@@ -12753,19 +12578,11 @@ 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"
@@ -12819,23 +12636,6 @@ 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"
}
@@ -14556,19 +14356,11 @@ 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"
@@ -14622,23 +14414,6 @@ 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"
}
@@ -16379,19 +16154,11 @@ 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"
@@ -16445,23 +16212,6 @@ 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"
}
@@ -18204,20 +17954,12 @@ 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"
@@ -18271,23 +18013,6 @@ 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"
}
@@ -20059,19 +19784,11 @@ 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"
@@ -20125,23 +19842,6 @@ 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 4afeb28195..c5755d03b5 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")
+ .add("-DDEBUG=1")
.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 305e337036..0df64354b5 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())
- .containsAllIn(
+ .isEqualTo(
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())
- .containsAllIn(
+ .isEqualTo(
new ImmutableList.Builder<String>()
.addAll(commonCompileFlags)
.add("-fno-objc-arc")
@@ -179,7 +179,7 @@ public class LegacyObjcLibraryTest extends ObjcLibraryTest {
.build();
assertThat(compileActionA.getArguments())
- .containsAllIn(
+ .isEqualTo(
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())
- .containsAllIn(
+ .isEqualTo(
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())
- .containsAllIn(
+ .containsExactlyElementsIn(
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())
- .containsAllIn(
+ .containsExactlyElementsIn(
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 ccfc3e970f..cdbc8833b7 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");
+ ImmutableList.of("-O0", "-DDEBUG=1");
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());
+ .containsAllIn(allExpectedCoptsBuilder.build()).inOrder();
}