Skip to content

Commit 77f38c0

Browse files
philj404contrem
authored andcommitted
CI: add unit tests
1 parent 302bcb9 commit 77f38c0

File tree

6 files changed

+396
-1
lines changed

6 files changed

+396
-1
lines changed

.github/workflows/aunit_tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: arduino-timer unit tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-18.04
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Setup
14+
run: |
15+
cd ..
16+
git clone https://github.com/bxparks/UnixHostDuino
17+
git clone https://github.com/bxparks/AUnit
18+
- name: Build Tests
19+
run: |
20+
make -C extras/tests
21+
- name: Run Tests
22+
run: |
23+
make -C extras/tests
24+
make -C extras/tests runtests
25+

.github/workflows/githubci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: arduino-timer Library CI
1+
name: arduino-timer platform builds
22

33
on: [pull_request, push, repository_dispatch]
44

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
Doxyfile*
55
doxygen_sqlite3.db
66
html
7+
*.out
8+
*.o
9+
*.swp

extras/tests/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
tests:
2+
set -e; \
3+
for i in *Test/Makefile; do \
4+
echo '==== Making:' $$(dirname $$i); \
5+
make -C $$(dirname $$i) -j; \
6+
done
7+
8+
runtests:
9+
set -e; \
10+
for i in *Test/Makefile; do \
11+
echo '==== Running:' $$(dirname $$i); \
12+
$$(dirname $$i)/$$(dirname $$i).out; \
13+
done
14+
15+
clean:
16+
set -e; \
17+
for i in *Test/Makefile; do \
18+
echo '==== Cleaning:' $$(dirname $$i); \
19+
make -C $$(dirname $$i) clean; \
20+
done

extras/tests/timerTest/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://github.com/bxparks/UnixHostDuino for documentation about this
2+
# Makefile to compile and run Arduino programs natively on Linux or MacOS.
3+
#
4+
5+
APP_NAME := timerTest
6+
ARDUINO_LIBS := AUnit arduino-timer
7+
CPPFLAGS += -Werror
8+
include ../../../../UnixHostDuino/UnixHostDuino.mk

0 commit comments

Comments
 (0)