Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf9c596

Browse filesBrowse files
Merge pull request FabioBatSilva#47 from FabioBatSilva/release
New Release and run examples on build
2 parents e8f5f2f + 8773edf commit cf9c596
Copy full SHA for cf9c596

File tree

Expand file treeCollapse file tree

9 files changed

+52
-141
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+52
-141
lines changed

‎.github/workflows/check.yaml

Copy file name to clipboardExpand all lines: .github/workflows/check.yaml
+31-2Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,40 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
os: [ubuntu-20.04]
11+
os: [ubuntu-22.04]
1212
steps:
1313
-
1414
name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
-
1717
name: Tests
1818
run: make
19+
20+
examples:
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-22.04]
26+
example: [mock-injection, wiring-blink]
27+
steps:
28+
-
29+
name: Checkout
30+
uses: actions/checkout@v3
31+
-
32+
uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.cache/pip
36+
~/.platformio/.cache
37+
key: ${{ runner.os }}-pio
38+
-
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: '3.9'
42+
-
43+
name: Install PlatformIO Core
44+
run: pip install --upgrade platformio
45+
-
46+
name: Tests
47+
run: pio test -d examples/wiring-blink/

‎examples/mock-injection/.gitignore

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
.pio
12
.pioenvs
23
.piolibdeps
4+
.clang_complete
5+
.gcc-flags.json

‎examples/mock-injection/.travis.yml

Copy file name to clipboardExpand all lines: examples/mock-injection/.travis.yml
-65Lines changed: 0 additions & 65 deletions
This file was deleted.
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[env:native]
22
platform = native
3-
build_flags = -std=gnu++11
4-
lib_deps = git@github.com:FabioBatSilva/ArduinoFake.git
3+
test_build_src = yes
4+
build_flags = -std=gnu++17
5+
6+
lib_deps = file://../../
7+
8+
# Use this instead of local file
9+
#lib_deps = FabioBatSilva/ArduinoFake

‎examples/mock-injection/test/test_my_service.cpp

Copy file name to clipboardExpand all lines: examples/mock-injection/test/test_my_service.cpp
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ void test_connect(void)
2424
MyService service(clientMock);
2525

2626
String response = service.request("myserver.com");
27-
2827
TEST_ASSERT_EQUAL(3, response.length());
2928
TEST_ASSERT_TRUE(response.equals("200"));
3029

@@ -33,8 +32,8 @@ void test_connect(void)
3332
Verify(OverloadedMethod(ArduinoFake(Client), read, int())).Exactly(3_Times);
3433

3534
Verify(OverloadedMethod(ArduinoFake(Client), println, size_t())).Once();
36-
Verify(OverloadedMethod(ArduinoFake(Client), println, size_t(const char *)).Using("STATUS")).Once();
37-
Verify(OverloadedMethod(ArduinoFake(Client), connect, int(const char*, uint16_t)).Using("myserver.com", 80)).Once();
35+
Verify(OverloadedMethod(ArduinoFake(Client), println, size_t(const char [])).Using((const char *)"STATUS")).Never();
36+
Verify(OverloadedMethod(ArduinoFake(Client), connect, int(const char[], uint16_t)).Using((const char *)"myserver.com", 80)).Once();
3837
}
3938

4039
int main(int argc, char **argv)

‎examples/wiring-blink/.gitignore

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.pio
12
.pioenvs
3+
.piolibdeps
24
.clang_complete
35
.gcc-flags.json

‎examples/wiring-blink/.travis.yml

Copy file name to clipboardExpand all lines: examples/wiring-blink/.travis.yml
-65Lines changed: 0 additions & 65 deletions
This file was deleted.

‎examples/wiring-blink/platformio.ini

Copy file name to clipboard
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[env:native]
22
platform = native
3-
build_flags = -std=gnu++11
4-
lib_deps = ArduinoFake
5-
# lib_deps = git@github.com:FabioBatSilva/ArduinoFake.git
3+
test_build_src = yes
4+
build_flags = -std=gnu++17
5+
6+
lib_deps = file://../../
7+
8+
#lib_deps = FabioBatSilva/ArduinoFake

‎library.json

Copy file name to clipboardExpand all lines: library.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ArduinoFake",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"keywords": "test, mock, fake, arduino",
55
"description": "Arduino mocking made easy.",
66
"repository": {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.