#Regression test missions

Regression tests are run using Tools/regression/runTest.py.  Without any 
arguments, all missions in the Missions/Regression folder with filenames that 
start with the word "test".  Optionally the path to a mission can be provided 
which will cause only that mission to be run.  If a 2nd argument is provided,
the mission won't be run, but the python test code will be run using the logs
from a previous run of the mission. 

Regression test missions are normal LRAUV missions, with the addition of 
python code wrapped in an XML comment and the tags "TEST\_CODE\_START" and
"TEST\_CODE\_END".  For example:

    <!--
    TEST\_CODE\_START
    # python code that sets value of "passed" variable, i.e.,
    passed = true
    TEST\_CODE\_END
    -->

One way to write a regression test is to just provide the above simple test 
script, and use <When> clauses in the missions with Critical level <Syslog> 
elements that are activated when the mission goes awry.  Any Critical syslogs 
cause the test mission to terminate, and fail the regression test.

Another way (which can be used in tandem with the above method) is to analyze
the data from the simulation in the python procedure. Utility library classes
are provided in Tools/regression, and do not need to be 
explicitly included.  

The most used library is Slate.py, which provides
[array of data] = slate.read("var1","var2","var3").  Examples:

    depth = slate.read("depth")[0]
    (lats, lons) = slate.read("latitude", "longitude")
    
Missions run at faster-than-realtime speed.  However if the tag "TEST\_WITH\_VALGRIND"
precedes the "TEST\_CODE\_START" tag, then the mission is simulated with valgrind
running in verbose mode, and will catch memory leaks and faults such as using
uninitialized memory. Any fault or memory leak will cause the test to fail.
But the simulation will run much more slowly... approaching
real-time.  So "TEST\_WITH\_VALGRIND" is recommeded only for missions that will 
complete within a few minutes of real-time.
