To use the script, an assignment in the testing account must be setup as follows:
A file called setup.properties must exist in the setup directory. maketests uses this file to determine the settings for the marmoset test. The following are options accepted for all tests.
Option | Effect |
TBD | |
The following is a list of the current types of default tests that can be implemented and the format of the setup directory for each type.
Used for testing bash scripts.
TBD
Used for testing students test suites for questions.
In maketest.config settings, there must be a line for each public, release and secret test "TESTNAME-tests=n" where TESTNAME is the name of a test and n is the number of tests associated with each test. This makes it possible to have multiple programs which need to be passed for a specific test on marmoset to pass.
In the setup directory, have a directory, by default calles src, for the source code for an assignment. This code will be altered to make buggy programs (described below).
Maketests will create a bash test for each test listed in maketest.config as normal based on the template at "~/marmoset/files/makefiles/testsetups/testing". This script should not be changed.
Maketests will also compile all buggy programs used for testing. This is done by compiling the source program with marcos TESTNAME and TESTNAME_i where i = 0 to n-1 to the name TESTNAME_i.
To create a buggy program, insert various if statements encapsulated in a preprocessor if command. For example,
#include <iostream> using namespace std; int main (){ int n; cin >> n; #ifdef SECRET0 int check; #ifdef SECRET0_0 check = 1; #endif #ifdef SECRET0_1 check = 20; #endif if ( check > n ){ cout << "Input greater than " << n << endl; } #endif cout << n << endl; }
When this program is compiled with the different marcos, the output will differ from what the expected output for the actual program when specific cases are meet, in this case if n > 2 or n > 20 depending on the test. For a student to pass secret0, they will have to have a tests in their testsuite which meet each condition.
Please document tests to describe what each test is testing for other coursestaff.
The template test for testing does the following:
Pipeline
TBD
TBD
TBD
TBD
-- KirstenBradley - 2016-05-18