This library triggers Xcode unit tests using John Holdsworth's injectionforxcode tool.
InjectionTDD immediatelly runs your related unit tests, every time you save implemntation file with ⌘+S.
InjectionTDD
library is written in Objective-C so it works with any Swift version.
xcode-select
.a
or static .framework
) used in a target.swift
file.
xcode-select
)xcode-select -p
sudo xcode-select -s /Applications/PATH_TO_YOUR_XCODE_VERSION/Contents/Developer
InjectionTDD
with your Xcode project:InjectionTDD is available through CocoaPods.
To install it, simply add the following line to your Podfile
, into Tests target ⚠️:
...
target 'REMTTests' do
# Your test Pods
pod 'InjectionTDD', '~> 0.5'
end
Add the following line to the Cartfile
and link generated .framework
library with your test target.
github "polac24/InjectionTDD"
.framework
Add binary framework to your test target. You can find compiled framework (InjectionTDD.framework.zip
) in releases section.
You can find sample integration on one approach to integrate binary framework.
InjectionTDD
integration with your test target (step 2.), run it (⌘+U) and you will see prompt Ready for InjectionTDD...
InjectionTDD
in your schema but adding INJECTION_TDD_SKIP=TRUE
environment variable in a test action:To display notification everytime your test finishes, install extra breakpoints that present a summary of your test suite:
⚠️ Remeber to install breakpoints when Xcode is closed, otherwise new breakpoints may not be added
mkdir -p /tmp/update_breakpoints_tdd && curl https://codeload.github.com/polac24/InjectionTDD/tar.gz/master | tar -xz --strip=3 --directory /tmp/update_breakpoints_tdd InjectionTDD-master/scripts/update_breakpoints/ && cd /tmp/update_breakpoints_tdd/ && ./update_breakpoints.sh && cd -
Podfile
) and provide two schemas: (1) used for TDD development only, (2) used for CI with disabled InjectionTDD (see how). This helps to quickly switch between standard and TDD development.Bartosz Polaczyk, [email protected]
This library is an addition to John Holdsworth great tool injectionforxcode. More details about live code injection you will find at Injection, the App and @Orta video post.
InjectionTDD is available under the MIT license. See the LICENSE file for more info.