Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit d81a468

Browse files
milendfacebook-github-bot
authored andcommitted
Extract framework search path test
Summary: Extracts target name so we can run the `apple_test_framework_search_path` test case with a different target (in D35181379). fbshipit-source-id: 5b13e0ddf7671a400a5c712edef94aa565bf9831
1 parent 4b0006a commit d81a468

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

test/com/facebook/buck/apple/AppleTestIntegrationTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,18 @@ public void testInfoPlistFromExportRule() throws IOException {
206206

207207
@Test
208208
public void testSetsFrameworkSearchPathAndLinksCorrectly() throws IOException {
209+
testSetsFrameworkSearchPathAndLinksCorrectlyWithTargetName("foo");
210+
}
209211

212+
private void testSetsFrameworkSearchPathAndLinksCorrectlyWithTargetName(String targetName)
213+
throws IOException {
210214
ProjectWorkspace workspace =
211215
TestDataHelper.createProjectWorkspaceForScenario(
212216
this, "apple_test_framework_search_path", tmp);
213217
workspace.setUp();
214218

215-
BuildTarget buildTarget = BuildTargetFactory.newInstance("//:foo#iphonesimulator-x86_64");
219+
BuildTarget buildTarget =
220+
BuildTargetFactory.newInstance(String.format("//:%s#iphonesimulator-x86_64", targetName));
216221
ProcessResult result = workspace.runBuckCommand("build", buildTarget.getFullyQualifiedName());
217222
result.assertSuccess();
218223

@@ -230,8 +235,8 @@ public void testSetsFrameworkSearchPathAndLinksCorrectly() throws IOException {
230235
BuildTargetPaths.getGenPath(
231236
filesystem.getBuckPaths(), appleTestBundleFlavoredBuildTarget, "%s")
232237
.getPath());
233-
Path bundlePath = outputPath.resolve("foo.xctest");
234-
Path testBinaryPath = bundlePath.resolve("foo");
238+
Path bundlePath = outputPath.resolve(String.format("%s.xctest", targetName));
239+
Path testBinaryPath = bundlePath.resolve(targetName);
235240

236241
assertTrue(Files.isDirectory(bundlePath));
237242
assertTrue(Files.isRegularFile(testBinaryPath));

0 commit comments

Comments
 (0)