xctspawn - Command line utility to execute XCTest unit and
UI tests locally on device.
xctspawn /path/to/test_run_file.xctestrun
[options]
To run your tests, point the tool at the xctestproducts file or
the xctestrun file sitting alongside your built tests. The tool will execute
the tests and generate an Xcode result bundle containing the test results
(pass/fail/skipped/xfail status, activities, attachments, crash reports,
etc.). Note that the tests must be built for the platform you are running
them on.
If this tool is interrupted via SIGINT while tests are still
executing, it will still generate a result bundle containing the test
results that have been produced so far.
- --result-bundle-path
/path/to/generated_result_bundle.xcresult
- Location that the generated result bundle should be placed. By default,
the result bundle is emitted to the current working directory.
- --result-stream-path
/path/to/result_stream.txt
- A path to a file or socket where events will be emitted during test
execution. Events include "suite started", "suite
finished", "test started", "test finished", etc.
The events are JSON-formatted XCResultKit types. For more information
about the event stream, see
https://confluence.sd.apple.com/display/DT/Using+xcodebuild%27s+event+stream
- --only-test-configuration
configuration
- Constrains testing by specifying test configurations to include, and
excluding other test configurations.
- --skip-test-configuration
configuration
- Constrains testing by specifying test configurations to exclude, but
including other test configurations.
- --only-testing
test identifier
- Constrains testing by specifying tests to include, and excluding other
tests. The test identifier takes the form
`TestTargetName[/TestClassName][/TestMethodName]`, e.g.
`MyTestTarget/MyTestClass/testFoo` (ObjC) or
`MyTestTarget/MyTestClass/testFoo()` (Swift).
- --skip-testing
test identifier
- Constrains testing by specifying tests to exclude, but including other
tests. The test identifier takes the form
`TestTargetName[/TestClassName][/TestMethodName]`, e.g.
`MyTestTarget/MyTestClass/testFoo` (ObjC) or
`MyTestTarget/MyTestClass/testFoo()` (Swift).
- --test-plan
- Specifies which test plan in the xctestproducts to run.
- --parallel-testing-enabled
YES | NO
- Overrides the per-target setting in the scheme/test plan.
- --parallel-testing-worker-count
number
- The exact number of test runners that will be spawned during parallel
testing.
- --parallel-testing-maximum-worker-count
number
- The maximum number of test runners that will be spawned during parallel
testing.
- --test-timeouts-enabled
YES | NO
- Enable or disable test timeout behavior.
- --default-test-execution-time-allowance
seconds
- The default execution time an individual test is given to execute, if test
timeouts are enabled.
- --maximum-test-execution-time-allowance
seconds
- The maximum execution time an individual test is given to execute,
regardless of the test's preferred allowance.
- --trace-collection-enabled
YES | NO
- Whether to collect a ktrace/artrace file during the execution of
performance tests.
- --enable-performance-tests-diagnostics
YES | NO
- Whether to collect a memgraphset file during the execution of performance
tests.
- --performance-test-configuration
/path/to/performance_test_configuration
- The path to a performance test configuration file that controls how
performance tests are executed.
- --test-iterations
number
- The number of times to execute each test, or, if either
--run-tests-until-failure or --retry-tests-on-failure are
specified, the maximum number of times each test will be executed.
- --run-tests-until-failure
- Run each test until it fails, up until a maximum number of iterations. The
maximum defaults to 100, but can be customized via the
--test-iterations option.
- --retry-tests-on-failure
- Re-run a failing test until it succeeds, up until a maximum number of
iterations. The maximum defaults to 3, but can be customized via the
--test-iterations option.
- --test-repetition-relaunch-enabled
YES | NO
- Enable or disable tests repeating in a new process for each repetition.
Must be used in conjunction with --test-iterations,
--retry-tests-on-failure, or --run-tests-until-failure. If
not specified, tests will repeat in the same process.
- --skip-app-reinstallation
- Don't install an app (either a test runner app or a UI target app) from
the build products if there is already a copy of the app installed on the
system. If there isn't a copy on the system, the app will still be
installed.
- --disable-code-coverage
- If the tests were built with code coverage enabled, this option will skip
the generation of a coverage report.
- --arg
value
- A command-line argument to supply to any test runner process that is
launched during test execution. Can be specified multiple times.
- --env
value
- A key-value pair of the form EnvVar=Value to supply as an environment
variable to any test runner process that is launched during test
execution.
- --enumerate-tests
- If specified, the set of tests that would normally execute will instead be
listed/enumerated, and the list of tests will be output to either stdout
(the default), or to a file whose location is specified via the
--test-enumeration-output-path option. The format of the list of
tests is controlled via the --test-enumeration-style and
--test-enumeration-format options.
- --test-enumeration-style
hierarchical | flat
- Whether tests should be enumerated in a hierarchical organization (the
default), meaning grouped by test plan, target, and class, or as a flat
list of test identifiers that can subsequently be passed to the
--skip-testing and --only-testing options.
- --test-enumeration-format
text | json
- Whether tests should be enumerated as human-readable text (the default),
or as machine-parseable JSON.
- --test-enumeration-output-path
path | -
- Specifies a file path where the list of tests computed by the
--enumerate-tests option will be written to disk. If - is supplied,
the data will be written to stdout (which is also the default if this
option is omitted).