You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow unit tests to import and link any main modules of executables that are implemented in Swift. This uses a new Swift compiler flag to set the name of the entry point when emitting object code, and then uses linker flags to rename the main executable module's entry point back to _main again when actually linking the executable.
This is guarded by a tools version check, since packages written this way won't be testable on older toolchains.
// Check if the host compiler supports the '-entry-point-function-name' flag. It's not needed for this test but is needed to build any executable from a package that uses tools version 999.0.
19
+
tryXCTSkipUnless(doesHostSwiftCompilerSupportRenamingMainSymbol(),"skipping because host compiler doesn't support '-entry-point-function-name'")
18
20
19
21
fixture(name:"Miscellaneous/Plugins"){ path in
20
22
do{
@@ -31,7 +33,10 @@ class PluginTests: XCTestCase {
// Check if the host compiler supports the '-entry-point-function-name' flag. It's not needed for this test but is needed to build any executable from a package that uses tools version 999.0.
38
+
tryXCTSkipUnless(doesHostSwiftCompilerSupportRenamingMainSymbol(),"skipping because host compiler doesn't support '-entry-point-function-name'")
// Check if the host compiler supports the '-entry-point-function-name' flag. It's not needed for this test but is needed to build any executable from a package that uses tools version 999.0.
57
+
tryXCTSkipUnless(doesHostSwiftCompilerSupportRenamingMainSymbol(),"skipping because host compiler doesn't support '-entry-point-function-name'")
0 commit comments