You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/contrib.md
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -79,3 +79,23 @@ Template for the pages (the one which creates small violet header and footer, de
79
79
`<!--?template myfunnytemplate-->`
80
80
81
81
The templates are cached for about 3600 seconds, rather than 300 seconds for ordinary pages, so be patient :)
82
+
83
+
## Tests
84
+
85
+
If your article involves code snippets, then it would be great you also contribute tests for them.
86
+
This way we can make sure that the snippets actually work, and don't contain any bugs.
87
+
88
+
Creating tests works like this:
89
+
You have to name each snippet that you want to test in the markdown article:
90
+
91
+
```cpp snippet-name
92
+
// some code
93
+
```
94
+
95
+
In the directory `test` you find a script `extract_snippets.py` that you can run.
96
+
This script extracts from every article all named snippets, and puts them in C++ header files: `snippet-name.h`
97
+
In the folder you can create a cpp file, that includes these snippets headers, and tests their behaviour.
98
+
If the snippets don't work, the test program should return 1 instead of 0.
99
+
100
+
You can run all tests with the script `test.sh`.
101
+
Also, every pull-request will automatically tested via [Travis CI](https://travis-ci.org/e-maxx-eng/e-maxx-eng/), and the result of the tests will be shown.
0 commit comments