Skip to content
Open
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
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,25 @@ CI is run automatically on all pull requests. However, if you want to run tests
- The `test/run_oss_cpp_tests.sh` script will build and run C++ tests locally
- Running `pytest` from the root directory will run Python tests locally. Make sure to run this after finishing [Dev Install](#dev-install).

To build C++ tests manually with CMake, run the following from the repository root:

```bash
cmake . -Bcmake-out -DCMAKE_INSTALL_PREFIX=cmake-out -DEXECUTORCH_BUILD_TESTS=ON
cmake --build cmake-out -j9 --target install
```

You can then use `ctest` to list or run individual C++ tests directly:

```bash
ctest --test-dir cmake-out -N
ctest --test-dir cmake-out -R <test_name_regex> --output-on-failure
```
Comment on lines +324 to +336

This workflow is useful when you want to rerun one test, attach a debugger to a
test binary under `cmake-out`, or keep a build directory around for quick rebuild
cycles. Add the same `-DEXECUTORCH_BUILD_*` options used by
`test/run_oss_cpp_tests.sh` when the test needs optional kernels or extensions.

### Writing Tests
To help keep code quality high, ExecuTorch uses a combination of unit tests and
end-to-end (e2e) tests. If you add a new feature or fix a bug, please add tests
Expand Down
Loading