Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: make check
run: make check
- uses: actions/checkout@v4
- name: Configure
run: cmake -B build -DBM8563_BUILD_TESTS=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
tests/unit
*.o
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ while (1) {

```

## Run unit tests

```
$ mkdir build && cd build
$ cmake -DBM8563_BUILD_TESTS=ON ..
$ make
$ ctest
```


## License

Expand Down
9 changes: 9 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_executable(unit unit.c mock_i2c.c)
target_link_libraries(unit PRIVATE bm8563)
target_compile_options(unit PRIVATE
-Wmissing-declarations
-Wmissing-prototypes
-Wstrict-prototypes
)

add_test(NAME unit COMMAND unit)