-
Notifications
You must be signed in to change notification settings - Fork 369
Continuous Integration and Code Coverage
This page is maintained by the community.
Given the variety of CI systems and the complexity of administering them, it is not feasible for us to provide support or recommendations. We use Jenkins and Travis CI to test the Calabash iOS Toolchain. If you are interested to see how we do it, have a look at the scripts in these repositories:
- https://github.com/calabash/ios-smoke-test-app
- https://github.com/calabash/calabash-ios-server
- https://github.com/calabash/run_loop
- Build and execute script: https://gist.github.com/2779815
by Manuel Binna
Issues with 'Developer Tools needs access ...' prompt
https://groups.google.com/d/msg/calabash-ios/PFafk2ca_cw/leapJzO5rHwJ
Credit! This notes are due to Trevor Harmon (@vocaro) - thanks alot!
Make sure you are running Xcode 4.6 or above. Previous versions had a Gcov bug in Clang.
• In the project’s Build Settings, change the following options:
Generate Test Coverage Files = Yes
Instrument Program Flow = Yes
This will generate Gcov notes files (*.gcno) when the program is built.
• Gcov will not write all of the output data for coverage analysis unless the app exits cleanly. (Quitting the iOS Simulator kills the app and does not allow it to exit cleanly.) To exit the app cleanly at the end of each scenario, add the following to your app’s Calabash launch file (launch.rb):
After do |scenario|
calabash_exit
end
• After the tests run, Gcov data files (*.gcda) will appear alongside the notes files in the app’s build directory. They can be analyzed with a tool such as CoverStory (http://code.google.com/p/coverstory/) or gcovr (https://software.sandia.gov/trac/fast/wiki/gcovr). Here is a script I use to generate a simple report using gcovr:
#!/bin/sh
set -ex
DERIVED_DATA_DIRECTORY=`cut -d "=" -f 2 cucumber.yml | sed 's:/Build/Products/Test-iphonesimulator/YOURAPP.app::'`
OBJECT_DIRECTORY=$DERIVED_DATA_DIRECTORY/Build/Intermediates/YOURAPP.build/Test-iphonesimulator/YOURAPP.build/Objects-normal/i386
gcovr/gcovr -r $PWD/../.. -e Libs/* $OBJECT_DIRECTORY
Replace YOURAPP with your app and modify as necessary.
Another nice thing about gcovr is that it can generate XML data consumable by Cobertura, which generates very nice HTML coverage reports and has a Jenkins plugin.
Feel free to add any of this to the wiki.
Trevor