-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rdar://105991217 (Make macros testable) #6312
Conversation
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have preferred a clearer variable name ,but none blocking.
does this need a test added?
macOS is failing with
|
Any suggestions? Happy to take them since I'll anyway will add a test as well. |
did not think about this too deeply, but my initial thought maybe this can be an extension on target |
+1 on changing the name to |
I think |
163639c
to
519bb38
Compare
let dirPath = (target.type == .executable && !allowLinkingAgainstExecutables) ? self.tempsPath : self | ||
.isLinux() || self.buildParameters.triple.isWindows()) && self.toolsVersion >= .v5_5 | ||
let supportsTestableExecutablesFeature = (target as? SwiftTarget)?.supportsTestableExecutablesFeature == true | ||
let dirPath = (supportsTestableExecutablesFeature && !allowLinkingAgainstExecutables) ? self.tempsPath : self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this wasn't actually checking for is SwiftTarget
before which means this check applied beyond the testable executables feature. I'm reverting this to be as before to avoid unnecessary changes.
Opt macros into testable executables if we're building them as executables.
519bb38
to
d632508
Compare
@swift-ci please smoke test |
Not sure yet how to write a test for this, I wanted to do an integration test since that seems to be the most useful in this case, but that is not possible because it requires a SwiftSyntax package dependency which seems prohibitive to include for several reasons. |
|
@swift-ci smoke test macos |
@swift-ci test windows |
Going to merge as-is since it isn't clear how to add a test at this time. |
@@ -731,10 +731,10 @@ public class BuildPlan: SPMBuildCore.BuildPlan { | |||
// In tool version .v5_5 or greater, we also include executable modules implemented in Swift in | |||
// any test products... this is to allow testing of executables. Note that they are also still | |||
// built as separate products that the test can invoke as subprocesses. | |||
case .executable, .snippet: | |||
case .executable, .snippet, .macro: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now causes a warning when building:
Build/BuildPlan.swift:770:22: warning: case is already handled by previous patterns; consider removing it
case .macro:
Opt macros into testable executables if we're building them as executables.