|
1 | 1 | { |
2 | | - "testcases" : [ |
3 | | - // Grading of C++ code can also be supplemented with the use of a memory |
4 | | - // debugger. Here, the tool Dr. Memory is used to penalize student code |
5 | | - // containing memory errors. |
6 | | - { |
7 | | - "type" : "Compilation", |
8 | | - "title" : "C++ - Compilation", |
9 | | - "command" : "clang++ -m32 -g -Wall -o a.out *.cpp", |
10 | | - "executable_name" : "a.out", |
11 | | - "points" : 5 |
12 | | - }, |
13 | | - { |
14 | | - "title" : "C++ - Memory Debugger", |
15 | | - "command" : "drmemory -brief -- ./a.out", |
16 | | - "points" : 5, |
17 | | - "validation" : [ |
| 2 | + "testcases" : [ |
| 3 | + |
| 4 | + // Grading of C++ code can also be supplemented with the use of a memory |
| 5 | + // debugger. Here, the tool Dr. Memory is used to penalize student code |
| 6 | + // containing memory errors. |
18 | 7 | { |
19 | | - "method" : "warnIfEmpty", |
20 | | - "actual_file" : "STDOUT.txt", |
21 | | - "description" : "Standard Output (STDOUT)" |
| 8 | + "type" : "Compilation", |
| 9 | + "title" : "C++ - Compilation (for Dr Memory)", |
| 10 | + "command" : "clang++ -m32 -g -Wall -o a.out *.cpp", |
| 11 | + "executable_name" : "a.out", |
| 12 | + "points" : 2 |
22 | 13 | }, |
23 | 14 | { |
24 | | - "method" : "DrMemoryGrader", |
25 | | - "actual_file" : "STDERR.txt", |
26 | | - "description" : "Standard Error (STDERR)", |
27 | | - "deduction" : 1.0 |
| 15 | + "title" : "Under Dr Memory", |
| 16 | + "command" : "drmemory -brief -- ./a.out", |
| 17 | + "points" : 5, |
| 18 | + "validation" : [ |
| 19 | + { |
| 20 | + "method" : "warnIfEmpty", |
| 21 | + "actual_file" : "STDOUT.txt", |
| 22 | + "description" : "Standard Output (STDOUT)" |
| 23 | + }, |
| 24 | + { |
| 25 | + "method" : "DrMemoryGrader", |
| 26 | + "actual_file" : "STDERR.txt", |
| 27 | + "description" : "Standard Error (STDERR)", |
| 28 | + "deduction" : 1.0 |
| 29 | + } |
| 30 | + ] |
28 | 31 | } |
29 | | - ] |
30 | | - } |
31 | | - ] |
| 32 | + |
| 33 | + // Valgrind is a similar tool |
| 34 | + { |
| 35 | + "type" : "Compilation", |
| 36 | + "title" : "C++ - Compilation (for Valgrind)", |
| 37 | + "command" : "clang++ -g -Wall -o a2.out *.cpp", |
| 38 | + "executable_name" : "a2.out", |
| 39 | + "points" : 2 |
| 40 | + }, |
| 41 | + { |
| 42 | + "title" : "Under Valgrind", |
| 43 | + "command" : "valgrind --leak-check=full ./a2.out", |
| 44 | + "points" : 5, |
| 45 | + "validation" : [ |
| 46 | + { |
| 47 | + "method" : "warnIfEmpty", |
| 48 | + "actual_file" : "STDOUT.txt", |
| 49 | + "description" : "Standard Output (STDOUT)" |
| 50 | + }, |
| 51 | + { |
| 52 | + "method" : "searchToken", |
| 53 | + "data" : [ "ERROR SUMMARY: 0 errors from 0 contexts" ], |
| 54 | + "actual_file" : "STDERR.txt", |
| 55 | + "description" : "Standard Error (STDERR)", |
| 56 | + "deduction" : 1.0 |
| 57 | + } |
| 58 | + ] |
| 59 | + } |
| 60 | + ] |
32 | 61 | } |
0 commit comments