-
Notifications
You must be signed in to change notification settings - Fork 58
Code coverage configuration
Andrii Mamchur edited this page Nov 13, 2013
·
1 revision
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install lcov
- JsonLiteObjC project (/platform/ios/JsonLiteObjC.xcodeproj or /platform/macos/JsonLiteObjC.xcodeproj)
- Open scheme editor Product->Scheme->Edit Scheme... (⌘<)
- Go to "Test" scheme
- Open Pre-actions
- Add "New Run Script Action". This script will reset all execution counts to zero.
cd "${TEMP_FILE_DIR}/Objects-normal/${CURRENT_ARCH}"
if [ -f "/usr/local/bin/lcov" ]; then
/usr/local/bin/lcov -z -d . --rc lcov_branch_coverage=1
fi
- Open Post-actions
- Add "New Run Script Action". This script will generate test coverage report.
cd "${TEMP_FILE_DIR}/Objects-normal/${CURRENT_ARCH}"
if [ -f "/usr/local/bin/lcov" ]; then
/usr/local/bin/lcov -c -d . -o coverage_full.info --rc lcov_branch_coverage=1
/usr/local/bin/lcov -r coverage_full.info tests\* -o coverage_no_tests.info --rc lcov_branch_coverage=1
/usr/local/bin/lcov -r coverage_no_tests.info /Applications/Xcode.app/\* -o coverage.info --rc lcov_branch_coverage=1
/usr/local/bin/genhtml coverage.info -o cov --rc lcov_branch_coverage=1
fi
Product->Test or ⌘U
- Open Organiser ⇧⌘2
- Open Projects Tab
- Select JsonLiteObjC project
- Click on arrow icon near Delivery Data path
- Open {Delivery Data}/Build/Intermediates/JsonLiteObjC.build/Debug-iphonesimulator/JsonLiteObjCTests.build/Objects-normal/cov/index.html