#!/bin/tcsh
# complete Dart test cycle on the client

# DashboardManager.tcl controls the test cyle via DartConfiguration.tcl and
# parameters
# 	testmode: 
#		$TEST_TYPE (tests regular all night or day :-)
#		Continuous (tests whenever changes have been made to the reposoritory)
#		Experimental (tests of software from local developer copy)
#	command: Start, Update,	Configure, Build, Test, Coverage, Doxygen,
#          Purify, Submit

###############################################################################
# set default values
###############################################################################

# dashboardmanager command
set MANAGER = "${DART_HOME}/Source/Client/DashboardManager.tcl"
# coverage parameter
set COVERAGE_PARAM = "$3";

###############################################################################
# read the command line arguments
###############################################################################

###############################################################################
# cd into the BuildDirectory which is necessary because the 
# "DartConfiguration.tcl" file resides in this directory
###############################################################################
cd $2;

###############################################################################
# build-test-submit cycle
###############################################################################
# the Start script creates the testing subtree which is needed to store 
#the test results
tclsh  $MANAGER DartConfiguration.tcl $1 Start; 

# the Update script makes an update against the cvs repository
tclsh $MANAGER DartConfiguration.tcl $1 Update; 

# the Configure script executes the configure command which is specified in 
# "DartConfiguration.tcl" file
tclsh $MANAGER DartConfiguration.tcl $1 Configure; 

# the Build script executes the build command which is specified in 
# "DartConfiguration.tcl" file 
tclsh $MANAGER DartConfiguration.tcl $1 Build;

# the Test scripts runs the tests which are specified in the several 
#"DartTestfile.txt" files
if ("$4" == "yes") then
    tclsh $MANAGER DartConfiguration.tcl $1 Test;
    if ($COVERAGE_PARAM == yes) then
	tclsh $MANAGER DartConfiguration.tcl $1 Coverage;
    endif
    tclsh $MANAGER DartConfiguration.tcl $1 Valgrind;
endif

# the Submit script sends the test information to the server
tclsh $MANAGER DartConfiguration.tcl $1 Submit;








