diff options
author | schmitt <schmitt@google.com> | 2017-08-14 23:37:56 +0200 |
---|---|---|
committer | Irina Iancu <elenairina@google.com> | 2017-08-16 11:05:15 +0200 |
commit | e29cb64e2b47d90f734beb4319d1ac708cb039a6 (patch) | |
tree | 08051bae4410f84a928ba5c799e109a25ed6d53c /src/test/java/com/google/devtools/build/lib | |
parent | 1e98851e9da9e7d9f83a71629b3a34fa77763487 (diff) |
Delete unused ObjcProvider keys.
RELNOTES: Removing a few unused objc_provider keys.
PiperOrigin-RevId: 165230824
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
3 files changed, 1 insertions, 73 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java index 6d8a4125ab..434164dbe0 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java @@ -150,11 +150,9 @@ public class AppleStaticLibraryTest extends ObjcRuleTestCase { ")"); ObjcProvider provider = providerForTarget("//package:test"); - // Do not remove SDK_FRAMEWORK or GENERAL_RESOURCE_FILE values in avoid_deps. + // Do not remove SDK_FRAMEWORK values in avoid_deps. assertThat(provider.get(ObjcProvider.SDK_FRAMEWORK)) .containsAllOf(new SdkFramework("AvoidSDK"), new SdkFramework("BaseSDK")); - assertThat(Artifact.toRootRelativePaths(provider.get(ObjcProvider.GENERAL_RESOURCE_FILE))) - .containsExactly("package/base.png"); } @Test diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcCommonTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcCommonTest.java deleted file mode 100644 index ce668797f9..0000000000 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcCommonTest.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2017 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -package com.google.devtools.build.lib.rules.objc; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.common.collect.ImmutableList; -import com.google.devtools.build.lib.actions.Artifact; -import com.google.devtools.build.lib.analysis.ConfiguredTarget; -import com.google.devtools.build.lib.analysis.util.BuildViewTestCase; -import com.google.devtools.build.lib.cmdline.Label; -import com.google.devtools.build.lib.vfs.FileSystemUtils; -import com.google.devtools.build.lib.vfs.ModifiedFileSet; -import com.google.devtools.build.lib.vfs.PathFragment; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** A test for {@link ObjcCommon}. */ -@RunWith(JUnit4.class) -public class ObjcCommonTest extends BuildViewTestCase { - - @Test - public void testObjcLibraryExternalStructuredResourcesNoErrors() throws Exception { - FileSystemUtils.appendIsoLatin1( - scratch.resolve("WORKSPACE"), - "local_repository(", - " name = 'pkg',", - " path = '/foo')"); - getSkyframeExecutor() - .invalidateFilesUnderPathForTesting( - reporter, - new ModifiedFileSet.Builder().modify(PathFragment.create("WORKSPACE")).build(), - rootDirectory); - FileSystemUtils.createDirectoryAndParents(scratch.resolve("/foo/bar/nested")); - scratch.file("/foo/bar/nested/file.txt"); - scratch.file("/foo/WORKSPACE", "workspace(name = 'pkg')"); - scratch.file( - "/foo/bar/BUILD", - "objc_library(name = 'lib',", - " srcs = ['foo.cc'],", - " structured_resources = ['nested/file.txt'])"); - Label label = Label.parseAbsolute("@pkg//bar:lib"); - ConfiguredTarget target = view.getConfiguredTargetForTesting(reporter, label, targetConfig); - Artifact artifact = getSharedArtifact("external/pkg/bar/nested/file.txt", target); - - // Verify that the xcodeStructuredResourceDirs call doesn't throw an exception and that the - // PathFragment it returns has the expected suffix, which includes the repository directory. - Iterable<Artifact> artifacts = ImmutableList.of(artifact); - Iterable<PathFragment> pathFragments = ObjcCommon.xcodeStructuredResourceDirs(artifacts); - - assertThat(pathFragments.iterator().hasNext()).isTrue(); - PathFragment fragment = pathFragments.iterator().next(); - assertThat(fragment.endsWith(PathFragment.create("external/pkg/bar/nested"))).isTrue(); - } -} 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 0b2fe6d22e..8ec3cc6111 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 @@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.google.devtools.build.lib.actions.util.ActionsTestUtil.baseArtifactNames; import static com.google.devtools.build.lib.actions.util.ActionsTestUtil.getFirstArtifactEndingWith; import static com.google.devtools.build.lib.rules.objc.LegacyCompilationSupport.AUTOMATIC_SDK_FRAMEWORKS; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.GENERAL_RESOURCE_FILE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.HEADER; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.INCLUDE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.MODULE_MAP; @@ -2123,8 +2122,6 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { getSourceArtifact("x/subdir_for_no_reason/en.lproj/loc.storyboard"), getSourceArtifact("x/ja.lproj/loc.storyboard")); - assertThat(provider.get(GENERAL_RESOURCE_FILE)) - .containsExactlyElementsIn(storyboardInputs); assertThat(provider.get(STORYBOARD)) .containsExactlyElementsIn(storyboardInputs); } |