The regression test driver... basically finds all the .os files under the
test subdirectory, and runs them in alphabetical order using the
following algorithm:
for( var itr=...; itr.hasNext(); )
{
var testfile = itr.next();
// run test with interpreter:
OscriptInterpreter.useCompiler(false);
import testfile;
OscriptInterpreter.flushNodeEvaluatorCache();
// run test with compiler:
OscriptInterpreter.useCompiler(true);
import testfile;
OscriptInterpreter.flushNodeEvaluatorCache();
}
The only reason the test driver is implemented as java is to minimize the
dependence on the scripting engine working properly in order to run the
tests.
Because the tests are run in alphabetical order, simpler test files should
be named such that they run before more complex tests, so basic language
features used by more complex tests are themselves tested first.
The functions expect(n) , logError(str) and
logInfo(str) are provided for the individual tests to report
the number of expected outputs, errors and status respectively.
The first thing an individual test should do is call expect(n)
to indicate the number of expected logInfo(str) or
logError(str) outputs. This is so the driver can catch
situations where the test did not execute fully.
author: Rob Clark (rob@ti.com) author: version: 1 |