Files
testator/README.md
T
2020-07-09 16:59:50 +02:00

1.8 KiB

Testator

This project contains a piece of code to run Jack tests locally using the more advanced ECJ compiler that can also generate classes, if there are compile errors. To build and execute the project you can simply execute gradle run with the associated arguments as follows:

./gradlew run --args="-i <jack_zip> -t <test_zip> -c <class1,class2,...>"

To successfully execute the Testator, you need to pass the following arguments:

 -c,--classes <arg>   Comma-separated list of classes with tests.
 -i,--input <arg>     Path name of zip with student code (exported with
                      the first option, by id and time).
 -t,--test <arg>      Path name of zip with testing code (without
                      framework, annotations and abstract base classes).

The final output will be a comma-separated list of student ids (first column), maximum task results and total points (last column).

Workflow

The Testator will identify student ids and uploads from the jack_zip. For each upload from each student the tool will generate a folder that will contain the files in the test_zip and the associated uploaded student code (student files will overwrite existing test files). The output will be generated in a "temp" directory that is in the same directory as the jack_zip. Once unpacked, the Testator uses the Eclipse Compiler for Java to compile the code and run the individual test files. It is assumed that the individual methods in each test class finish within 15 seconds. If this is not the case, they will be forcefully aborted (by stopping the Thread) since we assume that the student has produced an infinite loop. This should be more or less safe (although it is obviously ugly).

Important

This project requires Java 1.8 since the ecj BatchCompiler must be able to find the rt.jar to work correctly.