$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
g++ -o Example Example.cppor similar. You can also run your
makefile, if you have uploaded this to the
$FIXTURESfolder. Or use another compiler if you prefer.
$FIXTURES, in our case, we upload:
__wrap_main, this is so that we can override the
mainmethod of student code, if they have one.
update_cmake.shfile to update CMake on CodeGrade, run it using
./update_cmake.shin the Global Setup Script:
CMakeLists.txt, you may use the following as an example and edit it to fit your own assignment:
update_cmake.shas a $FIXTURE in the CodeGrade setup.
./update_cmake.shin the Global setup script.
CMakeLists.txtto the student directory in the per-student setup script and generate the Makefile using:
cp $FIXTURES/* $STUDENT; cmake .;.
cmake --build ..
--checks='cppcoreguidelines-*' sample1.cppto enable all core C++ checks and select the file you want to check (replace
sample1.cppwith 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.
$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.