$FIXTURESdirectory on the Virtual Server.
sudo apt install <package>. The global setup only runs once and is then cached, so the student submission won't be available here yet.
$STUDENTdirectory in case the student solution needs some input files to run correctly or if you are doing unit testing, as the unit tests have to be placed in the same directory as the student files. Move all fixtures with the following command:
cp $FIXTURES/* $STUDENT
gcc -o example -g example.cor similar. You can also run your
makefile, if you have uploaded this to the
$FIXTURESfolder. Or use another compiler if you prefer.
$FIXTUREand automatically run unit tests on the code.
test_money.c. Make sure to also include
#include <cg-check.h>in your code, to make it compatible with CodeGrade. Also, you will have to add the line
mainfunction to set the output file correctly for CodeGrade.
Makefile. See for instance this example:
cp $FIXTURES/test_money.c $STUDENT && cp $FIXTURES/Makefile $STUDENT.
--checks='*' money.cto enable all checks and select the file you want to check (replace
money.cwith your filename). Feel free to explore the other checks and options that are available for Clang-tidy.
…in the pattern) here, so that any code can be inside the blocks of the if-statement. The
$CONDcaptures any variable / condition. Save this in a file named for instance
...) is used to capture anything
$LST(list) capture the two parts of the for-loop declaration (the naming of these metavariables is irrelevant and could have been anything else).
Truefor the for-loop rule, we specify that we are expecting a match in order to pass that test.
valgrind --leak-check=yes --error-exitcode=1 -q ./example. Replace
./examplewith your student's executable.
$FIXTURE, execute it in this test and make sure it outputs a float between 0.0 and 1.0, this score will then be the number of points a student receives.