How to use xcodebuild with -only-testing and -skip-testing flag?

后端 未结 5 1900
误落风尘
误落风尘 2020-12-15 06:52

I\'ve noticed that there are two options in xcodebuild\'s man page.

-only-testing:TEST-IDENTIFIER       

constr

5条回答
  •  生来不讨喜
    2020-12-15 07:10

    Like what Marcio said, it's a path like string.

    For example, say you have a scheme named MyScheme, a test target MyUITests, and testing class LoginTest, then testing method testUserLogin, to run only the method, you can run

    xcodebuild -workspace Envoy.xcworkspace \
        -scheme MyScheme \
        -sdk iphonesimulator \
        -destination 'platform=iOS Simulator,name=iPad Air 2,OS=10.1'
        '-only-testing:MyUITests/LoginTest/testUserLogin' test
    

    Likewise, if you want to run all tests under LoginTest, here you run

    xcodebuild -workspace Envoy.xcworkspace \
        -scheme MyScheme \
        -sdk iphonesimulator \
        -destination 'platform=iOS Simulator,name=iPad Air 2,OS=10.1'
        '-only-testing:MyUITests/LoginTest' test
    

提交回复
热议问题