Name

runTests — Run a series of tests for a given rst suite

Synopsis

runTests

Description

runTests is a program that may be written for each rst suite. If provided, it will be executed for each student before the computeMarks program.

The runTests script is run by default from the course test account csXXXt. Its job is to build and execute the student's submission. Note that executing student code is an inherently unsafe, unsecure thing to do. This is why such execution is performed from a separate account which is configured specially to avoid security problems. Under no circumstances may student code be run directly by the course account.

It is also very important to use the Unix command 'timeout' for every command involving student code, including compilation. Compilation needs to be guarded because Makefiles can very easily infinitely recurse, and a student has even managed to make a generic command-line run of gcc version 3.4.2 time out. In general, this removes the risk of a student's program entering into an infinite loop and creating massively large output files (which can cause many problems). Even if you don't think there is any way for an infinite loop to occur you should play it safe, as you would surprised where infinite loops can show up.

As a rule, scripts should be as general as possible instead of specific to one assignment. This enables reuse for future assignments, and makes it easier for future course staff to see what was done and how it should be used.

runTests Environment

Within runTests, the following environment variables are defined for use. Not all of them may be useful for a given script.

submitdir

The student's submission directory.

tmpdir

The temporary scratch directory available for testing of this student's submission. This directory is also the "current directory" when runTests is started.

testdir

The directory containing runTests, computeMarks, and other files required by the test suite.

student

The userid of the student currently being tested.

assign

The name of the assignment, as passed to rst.

course

The name of the course that is running this test suite.

Topic revision: r1 - 2016-01-11 - YiLee
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback