Skip to content

Commit 18a49af

Browse files
committed
Add xdgTestHelper into the TestFoundation bundle as an auxiliaryExecutable.
- For Linux, set the output executable from the swiftc to go into the TestFoundation application directory. - For DarwinCompatibiltyTests, build xdgTestHelper as a command line tool then add a build phase to copy it to the 'Executables' destination. - For TestFoundation.app, build xdgTestHelper as a cocoa .app so that Xcode doesnt statically link it to the Foundation from the Swift toolchain, then copy the binary.
1 parent 2efe08c commit 18a49af

File tree

6 files changed

+75
-131
lines changed

6 files changed

+75
-131
lines changed

DarwinCompatibilityTests.xcodeproj/project.pbxproj

+26-84
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
B917D32620B0DE2000728EE0 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = B917D32520B0DE2000728EE0 /* main.swift */; };
1212
B95788861F6FB9470003EB01 /* TestNSNumberBridging.swift in Sources */ = {isa = PBXBuildFile; fileRef = B95788851F6FB9470003EB01 /* TestNSNumberBridging.swift */; };
1313
B987C65E2093C8AF0026B50D /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = B987C65D2093C8AF0026B50D /* TestImports.swift */; };
14-
B9C89ED21F6BF67C00087AF4 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9C89ED11F6BF67C00087AF4 /* XCTest.framework */; };
1514
B9C89F361F6BF89C00087AF4 /* TestScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C89EE61F6BF88F00087AF4 /* TestScanner.swift */; };
1615
B9C89F371F6BF89C00087AF4 /* TestNSValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C89EE71F6BF88F00087AF4 /* TestNSValue.swift */; };
1716
B9C89F381F6BF89C00087AF4 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C89EE81F6BF88F00087AF4 /* TestUtils.swift */; };
@@ -109,10 +108,20 @@
109108
B9C89FCC1F6DCAEB00087AF4 /* NSKeyedUnarchiver-NotificationTest.plist in Resources */ = {isa = PBXBuildFile; fileRef = B9C89FB71F6DCAEB00087AF4 /* NSKeyedUnarchiver-NotificationTest.plist */; };
110109
B9C89FCD1F6DCAEB00087AF4 /* PropertyList-1.0.dtd in Resources */ = {isa = PBXBuildFile; fileRef = B9C89FB81F6DCAEB00087AF4 /* PropertyList-1.0.dtd */; };
111110
B9C89FCE1F6DCAEB00087AF4 /* Test.plist in Resources */ = {isa = PBXBuildFile; fileRef = B9C89FB91F6DCAEB00087AF4 /* Test.plist */; };
112-
B9F3269F1FC714DD003C3599 /* DarwinShims.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9F3269E1FC714DD003C3599 /* DarwinShims.swift */; };
111+
B9F137A120B998D0000B7577 /* xdgTestHelper in CopyFiles */ = {isa = PBXBuildFile; fileRef = B917D31C20B0DB8B00728EE0 /* xdgTestHelper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
113112
B9F326A01FC714DD003C3599 /* DarwinShims.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9F3269E1FC714DD003C3599 /* DarwinShims.swift */; };
114113
/* End PBXBuildFile section */
115114

115+
/* Begin PBXContainerItemProxy section */
116+
B9F1379E20B9984F000B7577 /* PBXContainerItemProxy */ = {
117+
isa = PBXContainerItemProxy;
118+
containerPortal = B9C89EB91F6BF47D00087AF4 /* Project object */;
119+
proxyType = 1;
120+
remoteGlobalIDString = B917D31B20B0DB8B00728EE0;
121+
remoteInfo = xdgTestHelper;
122+
};
123+
/* End PBXContainerItemProxy section */
124+
116125
/* Begin PBXCopyFilesBuildPhase section */
117126
B917D31A20B0DB8B00728EE0 /* CopyFiles */ = {
118127
isa = PBXCopyFilesBuildPhase;
@@ -123,12 +132,13 @@
123132
);
124133
runOnlyForDeploymentPostprocessing = 1;
125134
};
126-
B9C89EBF1F6BF47D00087AF4 /* CopyFiles */ = {
135+
B9F137A020B998C0000B7577 /* CopyFiles */ = {
127136
isa = PBXCopyFilesBuildPhase;
128-
buildActionMask = 12;
129-
dstPath = usr/share/man/man1;
130-
dstSubfolderSpec = 7;
137+
buildActionMask = 2147483647;
138+
dstPath = "";
139+
dstSubfolderSpec = 6;
131140
files = (
141+
B9F137A120B998D0000B7577 /* xdgTestHelper in CopyFiles */,
132142
);
133143
runOnlyForDeploymentPostprocessing = 0;
134144
};
@@ -140,7 +150,6 @@
140150
B917D32520B0DE2000728EE0 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = main.swift; path = TestFoundation/xdgTestHelper/main.swift; sourceTree = "<group>"; };
141151
B95788851F6FB9470003EB01 /* TestNSNumberBridging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestNSNumberBridging.swift; path = TestFoundation/TestNSNumberBridging.swift; sourceTree = "<group>"; };
142152
B987C65D2093C8AF0026B50D /* TestImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TestImports.swift; path = TestFoundation/TestImports.swift; sourceTree = "<group>"; };
143-
B9C89EC11F6BF47D00087AF4 /* DarwinCompatibilityTests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DarwinCompatibilityTests; sourceTree = BUILT_PRODUCTS_DIR; };
144153
B9C89ED11F6BF67C00087AF4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
145154
B9C89ED71F6BF77E00087AF4 /* DarwinCompatibilityTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DarwinCompatibilityTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
146155
B9C89EDB1F6BF77E00087AF4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -255,14 +264,6 @@
255264
);
256265
runOnlyForDeploymentPostprocessing = 0;
257266
};
258-
B9C89EBE1F6BF47D00087AF4 /* Frameworks */ = {
259-
isa = PBXFrameworksBuildPhase;
260-
buildActionMask = 2147483647;
261-
files = (
262-
B9C89ED21F6BF67C00087AF4 /* XCTest.framework in Frameworks */,
263-
);
264-
runOnlyForDeploymentPostprocessing = 0;
265-
};
266267
B9C89ED41F6BF77E00087AF4 /* Frameworks */ = {
267268
isa = PBXFrameworksBuildPhase;
268269
buildActionMask = 2147483647;
@@ -394,7 +395,6 @@
394395
B9C89EC21F6BF47D00087AF4 /* Products */ = {
395396
isa = PBXGroup;
396397
children = (
397-
B9C89EC11F6BF47D00087AF4 /* DarwinCompatibilityTests */,
398398
B9C89ED71F6BF77E00087AF4 /* DarwinCompatibilityTests.xctest */,
399399
B917D31C20B0DB8B00728EE0 /* xdgTestHelper */,
400400
);
@@ -440,34 +440,19 @@
440440
productReference = B917D31C20B0DB8B00728EE0 /* xdgTestHelper */;
441441
productType = "com.apple.product-type.tool";
442442
};
443-
B9C89EC01F6BF47D00087AF4 /* DarwinCompatibilityTests */ = {
444-
isa = PBXNativeTarget;
445-
buildConfigurationList = B9C89EC81F6BF47D00087AF4 /* Build configuration list for PBXNativeTarget "DarwinCompatibilityTests" */;
446-
buildPhases = (
447-
B9C89EBD1F6BF47D00087AF4 /* Sources */,
448-
B9C89EBE1F6BF47D00087AF4 /* Frameworks */,
449-
B9C89EBF1F6BF47D00087AF4 /* CopyFiles */,
450-
);
451-
buildRules = (
452-
);
453-
dependencies = (
454-
);
455-
name = DarwinCompatibilityTests;
456-
productName = DarwinCompatibilityTests;
457-
productReference = B9C89EC11F6BF47D00087AF4 /* DarwinCompatibilityTests */;
458-
productType = "com.apple.product-type.tool";
459-
};
460443
B9C89ED61F6BF77E00087AF4 /* DarwinCompatibilityTests */ = {
461444
isa = PBXNativeTarget;
462445
buildConfigurationList = B9C89EDC1F6BF77E00087AF4 /* Build configuration list for PBXNativeTarget "DarwinCompatibilityTests" */;
463446
buildPhases = (
464447
B9C89ED31F6BF77E00087AF4 /* Sources */,
465448
B9C89ED41F6BF77E00087AF4 /* Frameworks */,
466449
B9C89ED51F6BF77E00087AF4 /* Resources */,
450+
B9F137A020B998C0000B7577 /* CopyFiles */,
467451
);
468452
buildRules = (
469453
);
470454
dependencies = (
455+
B9F1379F20B9984F000B7577 /* PBXTargetDependency */,
471456
);
472457
name = DarwinCompatibilityTests;
473458
productName = DarwinCompatibilityTests;
@@ -488,11 +473,6 @@
488473
CreatedOnToolsVersion = 9.3.1;
489474
ProvisioningStyle = Automatic;
490475
};
491-
B9C89EC01F6BF47D00087AF4 = {
492-
CreatedOnToolsVersion = 9.0;
493-
LastSwiftMigration = 0910;
494-
ProvisioningStyle = Automatic;
495-
};
496476
B9C89ED61F6BF77E00087AF4 = {
497477
CreatedOnToolsVersion = 9.0;
498478
ProvisioningStyle = Automatic;
@@ -511,7 +491,6 @@
511491
projectDirPath = "";
512492
projectRoot = "";
513493
targets = (
514-
B9C89EC01F6BF47D00087AF4 /* DarwinCompatibilityTests */,
515494
B9C89ED61F6BF77E00087AF4 /* DarwinCompatibilityTests */,
516495
B917D31B20B0DB8B00728EE0 /* xdgTestHelper */,
517496
);
@@ -558,14 +537,6 @@
558537
);
559538
runOnlyForDeploymentPostprocessing = 0;
560539
};
561-
B9C89EBD1F6BF47D00087AF4 /* Sources */ = {
562-
isa = PBXSourcesBuildPhase;
563-
buildActionMask = 2147483647;
564-
files = (
565-
B9F3269F1FC714DD003C3599 /* DarwinShims.swift in Sources */,
566-
);
567-
runOnlyForDeploymentPostprocessing = 0;
568-
};
569540
B9C89ED31F6BF77E00087AF4 /* Sources */ = {
570541
isa = PBXSourcesBuildPhase;
571542
buildActionMask = 2147483647;
@@ -654,6 +625,14 @@
654625
};
655626
/* End PBXSourcesBuildPhase section */
656627

628+
/* Begin PBXTargetDependency section */
629+
B9F1379F20B9984F000B7577 /* PBXTargetDependency */ = {
630+
isa = PBXTargetDependency;
631+
target = B917D31B20B0DB8B00728EE0 /* xdgTestHelper */;
632+
targetProxy = B9F1379E20B9984F000B7577 /* PBXContainerItemProxy */;
633+
};
634+
/* End PBXTargetDependency section */
635+
657636
/* Begin XCBuildConfiguration section */
658637
B917D32020B0DB8B00728EE0 /* Debug */ = {
659638
isa = XCBuildConfiguration;
@@ -789,34 +768,6 @@
789768
};
790769
name = Release;
791770
};
792-
B9C89EC91F6BF47D00087AF4 /* Debug */ = {
793-
isa = XCBuildConfiguration;
794-
buildSettings = {
795-
CLANG_ENABLE_MODULES = YES;
796-
CODE_SIGN_STYLE = Automatic;
797-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
798-
MACOSX_DEPLOYMENT_TARGET = 10.13;
799-
OTHER_SWIFT_FLAGS = "";
800-
"OTHER_SWIFT_FLAGS[arch=*]" = "";
801-
PRODUCT_NAME = "$(TARGET_NAME)";
802-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
803-
SWIFT_VERSION = 4.0;
804-
};
805-
name = Debug;
806-
};
807-
B9C89ECA1F6BF47D00087AF4 /* Release */ = {
808-
isa = XCBuildConfiguration;
809-
buildSettings = {
810-
CLANG_ENABLE_MODULES = YES;
811-
CODE_SIGN_STYLE = Automatic;
812-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
813-
MACOSX_DEPLOYMENT_TARGET = 10.13;
814-
OTHER_SWIFT_FLAGS = "";
815-
PRODUCT_NAME = "$(TARGET_NAME)";
816-
SWIFT_VERSION = 4.0;
817-
};
818-
name = Release;
819-
};
820771
B9C89EDD1F6BF77E00087AF4 /* Debug */ = {
821772
isa = XCBuildConfiguration;
822773
buildSettings = {
@@ -866,15 +817,6 @@
866817
defaultConfigurationIsVisible = 0;
867818
defaultConfigurationName = Release;
868819
};
869-
B9C89EC81F6BF47D00087AF4 /* Build configuration list for PBXNativeTarget "DarwinCompatibilityTests" */ = {
870-
isa = XCConfigurationList;
871-
buildConfigurations = (
872-
B9C89EC91F6BF47D00087AF4 /* Debug */,
873-
B9C89ECA1F6BF47D00087AF4 /* Release */,
874-
);
875-
defaultConfigurationIsVisible = 0;
876-
defaultConfigurationName = Release;
877-
};
878820
B9C89EDC1F6BF77E00087AF4 /* Build configuration list for PBXNativeTarget "DarwinCompatibilityTests" */ = {
879821
isa = XCConfigurationList;
880822
buildConfigurations = (

Foundation.xcodeproj/project.pbxproj

+33-32
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@
343343
B9974B9A1EDF4A22007F15B8 /* HTTPMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */; };
344344
B9974B9B1EDF4A22007F15B8 /* BodySource.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B941EDF4A22007F15B8 /* BodySource.swift */; };
345345
B9974B9C1EDF4A22007F15B8 /* EasyHandle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9974B951EDF4A22007F15B8 /* EasyHandle.swift */; };
346+
B9F1379A20B99455000B7577 /* xdgTestHelper in CopyFiles */ = {isa = PBXBuildFile; fileRef = B9F1379920B99455000B7577 /* xdgTestHelper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
346347
BB3D7558208A1E500085CFDC /* TestImports.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB3D7557208A1E500085CFDC /* TestImports.swift */; };
347348
BD8042161E09857800487EB8 /* TestLengthFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8042151E09857800487EB8 /* TestLengthFormatter.swift */; };
348349
BDBB65901E256BFA001A7286 /* TestEnergyFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */; };
@@ -455,6 +456,13 @@
455456
remoteGlobalIDString = 5B5D885C1BBC938800234F36;
456457
remoteInfo = SwiftFoundation;
457458
};
459+
B9F1379620B99357000B7577 /* PBXContainerItemProxy */ = {
460+
isa = PBXContainerItemProxy;
461+
containerPortal = 5B5D88541BBC938800234F36 /* Project object */;
462+
proxyType = 1;
463+
remoteGlobalIDString = 9F0DD33E1ECD734200F68030;
464+
remoteInfo = xdgTestHelper;
465+
};
458466
EA993CE21BEACD8E000969A2 /* PBXContainerItemProxy */ = {
459467
isa = PBXContainerItemProxy;
460468
containerPortal = 5B5D88541BBC938800234F36 /* Project object */;
@@ -485,6 +493,16 @@
485493
);
486494
runOnlyForDeploymentPostprocessing = 0;
487495
};
496+
B9F1379820B99363000B7577 /* CopyFiles */ = {
497+
isa = PBXCopyFilesBuildPhase;
498+
buildActionMask = 2147483647;
499+
dstPath = "";
500+
dstSubfolderSpec = 6;
501+
files = (
502+
B9F1379A20B99455000B7577 /* xdgTestHelper in CopyFiles */,
503+
);
504+
runOnlyForDeploymentPostprocessing = 0;
505+
};
488506
EA66F66D1BF56CCB00136161 /* CopyFiles */ = {
489507
isa = PBXCopyFilesBuildPhase;
490508
buildActionMask = 2147483647;
@@ -824,6 +842,7 @@
824842
B9974B931EDF4A22007F15B8 /* HTTPMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPMessage.swift; path = http/HTTPMessage.swift; sourceTree = "<group>"; };
825843
B9974B941EDF4A22007F15B8 /* BodySource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BodySource.swift; sourceTree = "<group>"; };
826844
B9974B951EDF4A22007F15B8 /* EasyHandle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EasyHandle.swift; sourceTree = "<group>"; };
845+
B9F1379920B99455000B7577 /* xdgTestHelper */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = xdgTestHelper; path = DerivedData/Foundation/Build/Products/Debug/xdgTestHelper.app/Contents/MacOS/xdgTestHelper; sourceTree = "<group>"; };
827846
BB3D7557208A1E500085CFDC /* TestImports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestImports.swift; sourceTree = "<group>"; };
828847
BD8042151E09857800487EB8 /* TestLengthFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestLengthFormatter.swift; sourceTree = "<group>"; };
829848
BDBB658F1E256BFA001A7286 /* TestEnergyFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEnergyFormatter.swift; sourceTree = "<group>"; };
@@ -1035,6 +1054,7 @@
10351054
5B5D88531BBC938800234F36 = {
10361055
isa = PBXGroup;
10371056
children = (
1057+
B9F1379920B99455000B7577 /* xdgTestHelper */,
10381058
B167A6641ED7303F0040B09A /* README.md */,
10391059
5BDC3F2C1BCC5DB500ED97BB /* Foundation */,
10401060
EAB57B681BD1A255004AC5C5 /* CoreFoundation */,
@@ -2019,10 +2039,12 @@
20192039
5BDC40591BD6D83B00ED97BB /* Frameworks */,
20202040
5BDC405A1BD6D83B00ED97BB /* Resources */,
20212041
5BDC406D1BD6D8B300ED97BB /* CopyFiles */,
2042+
B9F1379820B99363000B7577 /* CopyFiles */,
20222043
);
20232044
buildRules = (
20242045
);
20252046
dependencies = (
2047+
B9F1379720B99357000B7577 /* PBXTargetDependency */,
20262048
AE2FC5951CFEFC70008F7981 /* PBXTargetDependency */,
20272049
);
20282050
name = TestFoundation;
@@ -2537,6 +2559,11 @@
25372559
target = 5B5D885C1BBC938800234F36 /* SwiftFoundation */;
25382560
targetProxy = AE2FC5941CFEFC70008F7981 /* PBXContainerItemProxy */;
25392561
};
2562+
B9F1379720B99357000B7577 /* PBXTargetDependency */ = {
2563+
isa = PBXTargetDependency;
2564+
target = 9F0DD33E1ECD734200F68030 /* xdgTestHelper */;
2565+
targetProxy = B9F1379620B99357000B7577 /* PBXContainerItemProxy */;
2566+
};
25402567
EA993CE31BEACD8E000969A2 /* PBXTargetDependency */ = {
25412568
isa = PBXTargetDependency;
25422569
target = 5B7C8A6D1BEA7F8F00C5B690 /* CoreFoundation */;
@@ -2668,11 +2695,7 @@
26682695
INFOPLIST_FILE = Foundation/Info.plist;
26692696
INIT_ROUTINE = "___CFInitialize";
26702697
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
2671-
LD_RUNPATH_SEARCH_PATHS = (
2672-
"$(inherited)",
2673-
"@executable_path/../Frameworks",
2674-
"@loader_path/Frameworks",
2675-
);
2698+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
26762699
OTHER_CFLAGS = (
26772700
"-DCF_BUILDING_CF",
26782701
"-DDEPLOYMENT_TARGET_MACOSX",
@@ -2744,11 +2767,7 @@
27442767
INFOPLIST_FILE = Foundation/Info.plist;
27452768
INIT_ROUTINE = "___CFInitialize";
27462769
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
2747-
LD_RUNPATH_SEARCH_PATHS = (
2748-
"$(inherited)",
2749-
"@executable_path/../Frameworks",
2750-
"@loader_path/Frameworks",
2751-
);
2770+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
27522771
OTHER_CFLAGS = (
27532772
"-DCF_BUILDING_CF",
27542773
"-DDEPLOYMENT_TARGET_MACOSX",
@@ -2896,11 +2915,7 @@
28962915
/usr/include/libxml2,
28972916
);
28982917
INFOPLIST_FILE = TestFoundation/Resources/Info.plist;
2899-
LD_RUNPATH_SEARCH_PATHS = (
2900-
"$(inherited)",
2901-
"@executable_path/../Frameworks",
2902-
"@loader_path/../Frameworks",
2903-
);
2918+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
29042919
LIBRARY_SEARCH_PATHS = "$(inherited)";
29052920
MACH_O_TYPE = mh_execute;
29062921
OTHER_SWIFT_FLAGS = "-DDEPLOYMENT_ENABLE_LIBDISPATCH -swift-version 4";
@@ -2926,11 +2941,7 @@
29262941
/usr/include/libxml2,
29272942
);
29282943
INFOPLIST_FILE = TestFoundation/Resources/Info.plist;
2929-
LD_RUNPATH_SEARCH_PATHS = (
2930-
"$(inherited)",
2931-
"@executable_path/../Frameworks",
2932-
"@loader_path/../Frameworks",
2933-
);
2944+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
29342945
LIBRARY_SEARCH_PATHS = "$(inherited)";
29352946
MACH_O_TYPE = mh_execute;
29362947
OTHER_SWIFT_FLAGS = "-DDEPLOYMENT_ENABLE_LIBDISPATCH -swift-version 4";
@@ -2954,12 +2965,7 @@
29542965
CODE_SIGN_IDENTITY = "";
29552966
COMBINE_HIDPI_IMAGES = YES;
29562967
INFOPLIST_FILE = TestFoundation/xdgTestHelper/Info.plist;
2957-
LD_RUNPATH_SEARCH_PATHS = (
2958-
"$(inherited)",
2959-
"@executable_path/../../..",
2960-
"@loader_path/../../..",
2961-
"@executable_path/../Frameworks",
2962-
);
2968+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../../.. @loader_path/../../.. @executable_path/../Frameworks";
29632969
MACOSX_DEPLOYMENT_TARGET = 10.12;
29642970
PRODUCT_BUNDLE_IDENTIFIER = org.swift.xdgTestHelper;
29652971
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2981,12 +2987,7 @@
29812987
CODE_SIGN_IDENTITY = "";
29822988
COMBINE_HIDPI_IMAGES = YES;
29832989
INFOPLIST_FILE = TestFoundation/xdgTestHelper/Info.plist;
2984-
LD_RUNPATH_SEARCH_PATHS = (
2985-
"$(inherited)",
2986-
"@executable_path/../../..",
2987-
"@loader_path/../../..",
2988-
"@executable_path/../Frameworks",
2989-
);
2990+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../../.. @loader_path/../../.. @executable_path/../Frameworks";
29902991
MACOSX_DEPLOYMENT_TARGET = 10.12;
29912992
PRODUCT_BUNDLE_IDENTIFIER = org.swift.xdgTestHelper;
29922993
PRODUCT_NAME = "$(TARGET_NAME)";

TestFoundation/TestBundle.swift

+4-11
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,10 @@ internal func testBundleName() -> String {
2828
}
2929

3030
internal func xdgTestHelperURL() -> URL {
31-
#if DARWIN_COMPATIBILITY_TESTS
32-
let exeName = "/xdgTestHelper"
33-
#elseif os(macOS)
34-
let exeName = "/xdgTestHelper.app/Contents/MacOS/xdgTestHelper"
35-
#else
36-
let exeName = "/xdgTestHelper/xdgTestHelper"
37-
#endif
38-
39-
var path = testBundle().bundleURL.deletingLastPathComponent()
40-
path.appendPathComponent(exeName)
41-
return path
31+
guard let url = testBundle().url(forAuxiliaryExecutable: "xdgTestHelper") else {
32+
fatalError("Cant find xdgTestHelper")
33+
}
34+
return url
4235
}
4336

4437

0 commit comments

Comments
 (0)