Run Unit Test and Code Coverage

* xcode plugin will generage the test report, to do the same thing, we need xcpretty to export junit report

#proj + target and workspace + scheme

xcodebuild test \

    -workspace xxx.xcworkspace \

    -scheme xxx \

    -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.3' \

    -configuration "Debug" \

    -enableCodeCoverage YES \

    -derivedDataPath "build/Debug-iphonesimulator/" \

    | xcpretty -c -r junit -o xxx/test-reports/junit.xml

slather coverage --cobertura-xml \

--input-format profdata --ignore ../**/*/Xcode* --scheme xxx \

--workspace xxx.xcworkspace xxx.xcodeproj

猜你喜欢

转载自shappy1978.iteye.com/blog/2329535
今日推荐