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
14 changes: 8 additions & 6 deletions .github/actions/compile-examples/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# docker run --entrypoint bash --interactive --rm --tty --volume "$(pwd)":/host-volume/ --workdir /host-volume/ arduino-cli

# Define global arguments
ARG ARDUINO_CLI_VERSION=0.22.0
ARG ARDUINO_CLI_VERSION=0.23.0
ARG DEBIAN_FRONTEND="noninteractive"
ARG UID=1000
ARG USER="blues"
Expand Down Expand Up @@ -52,6 +52,7 @@ RUN ["dash", "-c", "\
apt-get update --quiet \
&& apt-get install --assume-yes --no-install-recommends --quiet \
bash \
bash-completion \
ca-certificates \
curl \
python-is-python3 \
Expand All @@ -70,14 +71,15 @@ RUN ["dash", "-c", "\
# Download/Install Arduino CLI
RUN ["dash", "-c", "\
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=${BINDIR} sh -s ${ARDUINO_CLI_VERSION} \
# && arduino-cli completion bash > /usr/share/bash-completion/completions/arduino-cli.sh \
&& mkdir -p /etc/bash_completion.d/ \
&& arduino-cli completion bash > /etc/bash_completion.d/arduino-cli.sh \
&& echo >> /etc/bash.bashrc \
# && echo \"for bcfile in /usr/share/bash-completion/completions/* ; do\" >> /etc/bash.bashrc \
# && echo \"for bcfile in /etc/bash_completion.d/* ; do\" >> /etc/bash.bashrc \
# && echo \" [ -f \\\"${ECHO_BC_FILE}\\\" ] && . \\\"${ECHO_BC_FILE}\\\"\" >> /etc/bash.bashrc \
# && echo \"done\" >> /etc/bash.bashrc \
&& echo \"for bcfile in /etc/bash_completion.d/* ; do\" >> /etc/bash.bashrc \
&& echo \" [ -f \\\"${ECHO_BC_FILE}\\\" ] && . \\\"${ECHO_BC_FILE}\\\"\" >> /etc/bash.bashrc \
&& echo \"done\" >> /etc/bash.bashrc \
&& echo \"if [ -f /etc/bash_completion ]; then\" >> /etc/bash.bashrc \
&& echo \" . /etc/bash_completion\" >> /etc/bash.bashrc \
&& echo \"fi\" >> /etc/bash.bashrc \
"]

# Configure Arduino CLI
Expand Down
1 change: 1 addition & 0 deletions .github/actions/run-tests-in-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FROM alpine:3.14
RUN ["ash", "-c", "\
apk add --no-cache \
g++ \
gdb \
valgrind \
"]

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.vscode/
.DS_Store
*.gch
*.out
*.gcda
*.gcno
*.gcov
vgcore.*

coverage/

Expand Down
78 changes: 78 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Failed Unit-tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/failed_test_run",
"args": [],
"cwd": "${workspaceRoot}",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "Debug Notecard Unit-tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/notecard.tests",
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Compile Notecard Tests",
"postDebugTask": "Clear Test Binaries",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "Debug NoteI2c Arduino Unit-tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/notei2c_arduino.tests",
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Compile NoteI2c Arduino Tests",
"postDebugTask": "Clear Test Binaries",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "Debug NoteI2c Arduino Unit-tests (-DWIRE_HAS_END)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/notei2c_arduino_wire_has_end.tests",
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Compile NoteI2c Arduino Tests (-DWIRE_HAS_END)",
"postDebugTask": "Clear Test Binaries",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "Debug NoteLog Arduino Unit-tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/notelog_arduino.tests",
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Compile NoteLog Arduino Tests",
"postDebugTask": "Clear Test Binaries",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "Debug NoteSerial Arduino Unit-tests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/noteserial_arduino.tests",
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Compile NoteSerial Arduino Tests",
"postDebugTask": "Clear Test Binaries",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
]
}
191 changes: 191 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "Compile and Run ALL Tests",
"command": "./test/run_all_tests.sh",
"args": [],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "cppbuild",
"label": "Compile Notecard Tests",
"command": "g++",
"args": [
"-Wall",
"-Wextra",
"-Wpedantic",
"test/mock/mock-arduino.cpp",
"test/mock/mock-note-c-note.c",
"test/mock/NoteI2c_Mock.cpp",
"test/mock/NoteLog_Mock.cpp",
"test/mock/NoteSerial_Mock.cpp",
"src/Notecard.cpp",
"test/Notecard.test.cpp",
"-std=c++11",
"-Itest",
"-Isrc",
"-DNOTE_MOCK",
"-o",
"notecard.tests",
"-g",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "cppbuild",
"label": "Compile NoteI2c Arduino Tests",
"command": "g++",
"args": [
"-Wall",
"-Wextra",
"-Wpedantic",
"test/mock/mock-arduino.cpp",
"test/mock/mock-note-c-note.c",
"src/NoteI2c_Arduino.cpp",
"test/NoteI2c_Arduino.test.cpp",
"-std=c++11",
"-Itest",
"-Isrc",
"-DNOTE_MOCK",
"-o",
"notei2c_arduino.tests",
"-g",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "cppbuild",
"label": "Compile NoteI2c Arduino Tests (-DWIRE_HAS_END)",
"command": "g++",
"args": [
"-Wall",
"-Wextra",
"-Wpedantic",
"test/mock/mock-arduino.cpp",
"test/mock/mock-note-c-note.c",
"src/NoteI2c_Arduino.cpp",
"test/NoteI2c_Arduino.test.cpp",
"-std=c++11",
"-Itest",
"-Isrc",
"-DNOTE_MOCK",
"-DWIRE_HAS_END",
"-o",
"notei2c_arduino_wire_has_end.tests",
"-g",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "cppbuild",
"label": "Compile NoteLog Arduino Tests",
"command": "g++",
"args": [
"-Wall",
"-Wextra",
"-Wpedantic",
"test/mock/mock-arduino.cpp",
"test/mock/mock-note-c-note.c",
"src/NoteLog_Arduino.cpp",
"test/NoteLog_Arduino.test.cpp",
"-std=c++11",
"-Itest",
"-Isrc",
"-DNOTE_MOCK",
"-o",
"notelog_arduino.tests",
"-g",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "cppbuild",
"label": "Compile NoteSerial Arduino Tests",
"command": "g++",
"args": [
"-Wall",
"-Wextra",
"-Wpedantic",
"test/mock/mock-arduino.cpp",
"test/mock/mock-note-c-note.c",
"src/NoteSerial_Arduino.cpp",
"test/NoteSerial_Arduino.test.cpp",
"-std=c++11",
"-Itest",
"-Isrc",
"-DNOTE_MOCK",
"-o",
"noteserial_arduino.tests",
"-g",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "shell",
"label": "Clear Test Binaries",
"command": "rm -rf *.tests",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
},
]
}
Loading