Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions testing/ios/IosUnitTests/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
# iOS Unit Tests

These are the unit tests for iOS engine. They can be executed locally and are
These are the unit tests for iOS engine. They can be executed locally and are
also run in LUCI builds.

## Running Tests
## Running Tests from command line

To build and run the iOS tests, run the following script from the src directory:
To build and run the iOS tests, use the `run_tests` script from the `src` directory.

```sh
flutter/testing/run_tests.py --type=objc
```

And if you're on Apple Silicon:

```sh
./flutter/testing/run_tests.py \
--type=objc \
--ios-variant ios_debug_sim_unopt_arm64
```

The `.xcresult` is automatically removed after testing ends. To change this:

```sh
export FLUTTER_TEST_OUTPUTS_DIR=~/Desktop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We set FLUTTER_TEST_OUTPUTS_DIR env in our CI system, however if it's useful to be used on the command line parser.add_argument output option around here

parser.add_argument(

And use that and fallback to FLUTTER_TEST_OUTPUTS_DIR is currently used, first if it's not passed in.

luci_test_outputs_path = os.environ.get('FLUTTER_TEST_OUTPUTS_DIR')

luci_test_outputs_path = os.environ.get('FLUTTER_TEST_OUTPUTS_DIR')

However if you don't want to touch the python code I understand. 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I'd prefer to leave it as it is (I'm low on time), but I might come back to it in the future and add a proper argument for that.

```

To learn more:

```
flutter/testing/run_tests.py --help
```

## Running Tests from Xcode

After the `ios_test_flutter` target is built you can also run the tests inside
of Xcode with `testing/ios/IosUnitTests/IosUnitTests.xcodeproj`.

Expand Down