-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor --init mode for library package support, Adds test stubs to libs #141
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
Conversation
Only libraries are testable at this time, it works on Darwin because we build an xctest bundle, however it would stop working if we built there were two executable modules being compiled into the bundle. It doesn't work on Linux because we build a main into the test runner. So at this time, I'm not sure we can merge this unless we change I considered compiling executable modules in two parts, a module with everything except the main.swift and then the executable product with the main.swift, however this simply won't work if any non-private state exists in Possibly there is a solution if on Linux we compile each module as a dylib, but I'm not 100% sure how this would affect the |
how about having two modes for |
90002ed
to
9d52df2
Compare
5465061
to
7ee8a22
Compare
rebased |
7ee8a22
to
943d8cc
Compare
K, looks good. Lets make it |
943d8cc
to
88a39e4
Compare
@mxcl done |
@swift-ci Please test |
@mxcl is there any changes required in this PR? |
We can squash and merge. I'll update the swift-3 branch if needed tomorrow. |
…stubs for libraries
88a39e4
to
f10727c
Compare
Rebased and squashed |
@swift-ci Please test |
Refactor --init mode for library package support, Adds test stubs to libs
[BuildSystem] Diagnose duplicate command names.
[pull] swiftwasm from master
Adds two modes to
--init
:--init library
and--init exec
with executable as default if not specified.--init exec
or--init
behaves same as before--init library
mode:Sources/MyAwesomePackage.swift
contains empty struct of the same name :Tests/MyAwesomePackage/MyAwesomePackage.swift
:Tests/LinuxMain.swift
:Executable currently don't support proper testing so no test stubs are generated for executables :
swift-test
works properly on OSX but fails with the below error on Linux for packages containing main.swift, however works correctly for libs :