Skip to content

Commit db6950e

Browse files
authored
Update CONTRIBUTING.md
fixed typos
1 parent c846130 commit db6950e

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ I was missing `sei()`, `cli()` and `attachInterrupt()` in ArduinoFake, here is l
99
* `attachInterrupt()` was already in [Arduino.h](/src/arduino/Arduino.h) so we are done.
1010
* `sei()` was not defined in [Arduino.h](/src/arduino/Arduino.h) so
1111
* create a new header file [avr/interrupt.h](/src/arduino/avr/interrupt.h) to cover interrupt related definitions with a content
12-
```c
12+
```c++
1313
/**
1414
* Fake version of avr/interrupt.h
1515
*/
@@ -18,14 +18,14 @@ I was missing `sei()`, `cli()` and `attachInterrupt()` in ArduinoFake, here is l
1818
* add `#include "avr/interrupt.h"` in [Arduino.h](/src/arduino/Arduino.h)
1919
1. Find approriate place for your functions, in my case I extended [src/FunctionFake.h](/src/FunctionFake.h) for new functions
2020
```c++
21-
struct FunctionFake
21+
struct FunctionFake
2222
{
23-
...
23+
...
2424
virtual void attachInterrupt(uint8_t, void (*)(void), int mode) = 0;
25-
virtual void cli() = 0;
26-
virtual void sei() = 0;
27-
...
28-
}
25+
virtual void cli() = 0;
26+
virtual void sei() = 0;
27+
...
28+
}
2929
```
3030
1. add default implementations into corresponding cpp file, in my case [src/FunctionFake.cpp](/src/FunctionFake.cpp).
3131
```c++
@@ -41,7 +41,7 @@ I was missing `sei()`, `cli()` and `attachInterrupt()` in ArduinoFake, here is l
4141
ArduinoFakeInstance(Function)->sei();
4242
}
4343
```
44-
1. **don't forgot to add TESTs** for new functionality, at least test if a function can be executed, in my case [test/test_functio.h](/test/test_functio.h)
44+
1. **don't forget to add TESTs** for new functionality, at least test if a function can be executed, in my case [test/test_function.h](/test/test_function.h)
4545
```c++
4646
void test_attach(void)
4747
{
@@ -78,21 +78,33 @@ I was missing `sei()`, `cli()` and `attachInterrupt()` in ArduinoFake, here is l
7878
{
7979
...
8080
RUN_TEST(FunctionTest::test_attach);
81-
RUN_TEST(FunctionTest::test_cli);
82-
RUN_TEST(FunctionTest::test_sei);
81+
RUN_TEST(FunctionTest::test_cli);
82+
RUN_TEST(FunctionTest::test_sei);
8383
...
8484
}
85-
1. excersice tests from command line
85+
1. excersice tests from command line, there are two ways based on your Makefile
86+
* default project [Makefile](/Makefile),
87+
* execute `make`
88+
* verify
8689
```
87-
make clean all && test/main
90+
Running tests...
91+
Test project /home/vlcvi01/Dropbox/git/ArduinoFake/build
92+
Start 1: main
93+
1/1 Test #1: main ............................. Passed 0.01 sec
94+
95+
100% tests passed, 0 tests failed out of 1
8896
```
89-
verify PASS of all tests
97+
* [eclipse based Makefile](https://www.mantidproject.org/Setting_up_Eclipse_projects_with_CMake) generated via `cmake -G "Eclipse CDT4 - Unix Makefiles"`.
98+
* execute `make clean all && test/main`
99+
* verify PASS of all tests
90100
```
101+
...
91102
.../ArduinoFake/test/main.cpp:184:FunctionTest::test_attach:PASS
92103
.../ArduinoFake/test/main.cpp:185:FunctionTest::test_sei:PASS
93104
.../ArduinoFake/test/main.cpp:186:FunctionTest::test_cli:PASS
94-
105+
...
106+
95107
-----------------------
96108
39 Tests 0 Failures 0 Ignored
97109
OK
98-
```
110+
```

0 commit comments

Comments
 (0)