Skip to content

Add some basic build instructions to run unit tests #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 24, 2022
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
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,36 @@ This repository includes a test suite that covers most of the API and that is de

Please help us improve the coverage of the test suite!

#### To build and run unit tests

The unit tests are automatically built by GitHub as part of pull request checks (in `.github/workflows/unit-tests.yml`).

To build and run locally:

**Dependencies**

* [CMake](https://cmake.org/)
* [GCC](https://gcc.gnu.org/)

On (Ubuntu) Linux run:

```bash
sudo apt-get install build-essential cmake
```

From the project root:

```bash
cd test && mkdir build && cd build
cmake ..
make && bin/test-ArduinoCore-API
```

### Implementing ArduinoCore-API

In order to compile a core which is implementing ArduinoCore-API you'll need to copy/symlink the `api` directory to the target's `cores/arduino` directory as part of your development and release workflow. The most elegant and effective solution is to develop your core with `api` symlinked and produce the distributable archive by telling `tar` to follow symlinks. Example:

```
```bash
tar --exclude='*.git*' -cjhvf $yourcore-$version.tar.bz2 $yourcore/
```

Expand Down