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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326525319&siteId=291194637