diff options
author | bbaren <bbaren@google.com> | 2018-08-15 13:58:00 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-15 13:59:26 -0700 |
commit | c5442570ecba9a540a552825c8aed7ac9c62c321 (patch) | |
tree | c5d3eb1b56ab2b8faa444d130361149c2537ac92 /src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java | |
parent | e2f61b197a1375b04222aa99a6bbcb290a19e36c (diff) |
When setting the standard Xcode version feature (see
commit eb952d08f76afa907bb34eaf7e1a69899102c523), always use exactly two
components for the version number. Grouping all point releases together
simplifies writing CROSSTOOLs.
Also fix a bug in MockObjcSupport that prevented Xcode version selection
in tests from working properly.
RELNOTES:
The standard `xcode_VERSION` feature now always uses exactly two
components in the version, even if you specify `--xcode_version` with
more or fewer than two.
PiperOrigin-RevId: 208877588
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java index f0eb7ec5cc..ce828e5523 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java @@ -1266,6 +1266,30 @@ public class ObjcLibraryTest extends ObjcRuleTestCase { } @Test + public void testXcodeVersionFeatureTwoComponentsTooMany() throws Exception { + useConfiguration("--xcode_version=7.3.1"); + + createLibraryTargetWriter("//objc:lib") + .setAndCreateFiles("srcs", "a.m") + .write(); + CommandAction action = compileAction("//objc:lib", "a.o"); + + assertThat(action.getArguments()).contains("-DXCODE_FEATURE_FOR_TESTING=xcode_7.3"); + } + + @Test + public void testXcodeVersionFeatureTwoComponentsTooFew() throws Exception { + useConfiguration("--xcode_version=5"); + + createLibraryTargetWriter("//objc:lib") + .setAndCreateFiles("srcs", "a.m") + .write(); + CommandAction action = compileAction("//objc:lib", "a.o"); + + assertThat(action.getArguments()).contains("-DXCODE_FEATURE_FOR_TESTING=xcode_5.0"); + } + + @Test public void testIosSdkVersionCannotBeDefinedButEmpty() throws Exception { try { useConfiguration("--ios_sdk_version="); |