|
1 | 1 | --- |
2 | 2 | title: Program in C++ |
3 | | -description: "# C++ Task Example\n\nThis is a basic C++ task to get you started quickly with Code FREAK.\n\nTo turn this into a useful programming exercise, you have to do the following.\n\n## Provide Code to Students\n\nIf you do not want your students to start completely from scratch, provide some scaffolding code. Look into `src` for some inspiration.\n\n## Setup Automatic Evaluation\n\nThis example comes with a pre-configured evaluation step. You can see it in the _Evaluation_ tab. To try it out, enter _testing mode_ and start the evaluation.\n\n### Unit Tests\n\nUnit tests are your main instrument for automatically validating your students' answers. To get started, look into `test` for example test cases.\n\nThe standard testing framework for C++ is googletest. Refer to the [official documentation](https://github.com/google/googletest) for more information.\n\n## Provide Instructions\n\nClick on this text to edit it. Here you describe to your students what they have to do.\n" |
| 3 | +description: |- |
| 4 | + # C++ Task Example |
| 5 | +
|
| 6 | + This is a basic C++ task to get you started quickly with Code FREAK. |
| 7 | +
|
| 8 | + To turn this into a useful programming exercise, you have to do the following. |
| 9 | +
|
| 10 | + ## Provide Code to Students |
| 11 | +
|
| 12 | + If you do not want your students to start completely from scratch, provide some scaffolding code. Look into `src` for some inspiration. |
| 13 | +
|
| 14 | + ## Setup Automatic Evaluation |
| 15 | +
|
| 16 | + This example comes with a pre-configured evaluation step. You can see it in the _Evaluation_ tab. To try it out, enter _testing mode_ and start the evaluation. |
| 17 | +
|
| 18 | + ### Static Code Analysis |
| 19 | +
|
| 20 | + The code is anaylzed using [cpplint](https://github.com/cpplint/cpplint) for proper formatting, which enforces [Google's C++ code styleguide](https://github.com/google/styleguide). |
| 21 | +
|
| 22 | + ### Unit Tests |
| 23 | +
|
| 24 | + Unit tests are your main instrument for automatically validating your students' answers. To get started, look into `test` for example test cases. |
| 25 | +
|
| 26 | + The standard testing framework for C++ is googletest. Refer to the [official documentation](https://github.com/google/googletest) for more information. |
| 27 | +
|
| 28 | + ## Provide Instructions |
| 29 | +
|
| 30 | + Click on this text to edit it. Here you describe to your students what they have to do. |
4 | 31 | hidden: |
5 | 32 | - test/** |
6 | | -- .codeclimate.yml |
7 | 33 | protected: |
8 | 34 | - CMakeLists.txt |
9 | 35 | evaluation: |
10 | | -- step: comments |
11 | | - options: {} |
12 | | - title: Comments |
13 | | -- step: junit |
14 | | - options: |
15 | | - image: rikorose/gcc-cmake |
16 | | - results-path: test-results |
17 | | - project-path: /code |
18 | | - commands: |
19 | | - - "rm -rf build # Remove possible build files because there might be conflicting settings (i.e. the compiler path) from external builds" |
20 | | - - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" |
21 | | - - make -C build ExampleProject_tst |
22 | | - - build/test/ExampleProject_tst --gtest_output=xml:test-results/TEST-report.xml |
23 | | - title: Unit Tests |
24 | | -- step: codeclimate |
25 | | - options: {} |
26 | | - title: Code Quality |
| 36 | + unit-tests: |
| 37 | + title: Unit Tests |
| 38 | + script: |- |
| 39 | + # Remove possible build files because there might be conflicting settings (i.e. the compiler path) from external builds" |
| 40 | + rm -rf build |
| 41 | + mkdir -p build |
| 42 | + cd build |
| 43 | + cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" .. |
| 44 | + make ExampleProject_tst |
| 45 | + test/ExampleProject_tst --gtest_output=xml:test-results/TEST-report.xml |
| 46 | + report: |
| 47 | + format: junit-xml |
| 48 | + path: build/test-results/TEST-report.xml |
| 49 | + code-quality: |
| 50 | + title: Code Quality |
| 51 | + script: |- |
| 52 | + pip3 install cpplint |
| 53 | + # Errors will be written to stderr |
| 54 | + cpplint --recursive --output=vs7 --root=src --filter=-legal/copyright --quiet src 2> cpplint-report.txt |
| 55 | + report: |
| 56 | + format: visualstudio |
| 57 | + path: cpplint-report.txt |
0 commit comments