BASIS  r3148
basistest-master.sh File Reference

Test master which can be run as a cron job. More...

#include "${BASIS_BASH_UTILITIES}"
+ Include dependency graph for basistest-master.sh:

Go to the source code of this file.

Functions

function date2stamp (in date)
 Convert date to timestamp.
function date_add (in unit, in date, in interval)
 Adds a certain time interval to a given date.
function date_diff (in unit, in date1, in date2)
 Computes the time interval between two given dates.
function print_help ()
 Print help.
function print_helpshort ()
 Print usage (i.e., only usage and options).
function print_options ()
 Print documentation of options.
function run_test (in project, in branch, in model, in options)
 Runs a test given the arguments in the configuration file.
function schedule_date ()
 Get next scheduled date of a given test.
function schedule_test (in date, in time, in project, in branch, in model)
 Add entry to test schedule.
function stamp2date (in stamp)
 Convert timestamp to date.

Detailed Description

Test master which can be run as a cron job.

This shell script is supposed to be scheduled as cron job, where possibly the basistest-cron.sh script is in fact used as cron job command without arguments where all the settings for the cron job are fixed within this latter script. On execution, this master script parses the configuration file and executes the configured tests using by default the basistest-slave.sh script.

Copyright (c) 2011 University of Pennsylvania. All rights reserved.
See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.

Contact: SBIA Group <sbia-software at uphs.upenn.edu>

Definition in file basistest-master.sh.


Function Documentation

function date2stamp ( in  date)

Convert date to timestamp.

Parameters:
[in]dateDate.
Returns:
Prints timestamp corresponding to given date to STDOUT.
function date_add ( in  unit,
in  date,
in  interval 
)

Adds a certain time interval to a given date.

Parameters:
[in]unitUnit of the time interval. Either one of -s, -m, -h, or -d. Defaults to number of days.
[in]dateThe date to which the time interval is added.
[in]intervalThe time interval given in the specified units.
Returns:
Prints the date which is interval time units after the given date to STDOUT.
function date_diff ( in  unit,
in  date1,
in  date2 
)

Computes the time interval between two given dates.

Parameters:
[in]unitUnit of the time interval. Either one of -s, -m, -h, or -d. Defaults to number of days.
[in]date1The first date.
[in]date2The second date.
Returns:
Prints time interval, i.e., an absolute value, in the given units to STDOUT.
function print_help ( )

Print help.

Returns:
Nothing.
function print_helpshort ( )

Print usage (i.e., only usage and options).

Returns:
Nothing.
function print_options ( )

Print documentation of options.

Returns:
Nothing.
function run_test ( in  project,
in  branch,
in  model,
in  options 
)

Runs a test given the arguments in the configuration file.

Parameters:
[in]projectName of the project to test.
[in]branchName of the branch to test.
[in]modelName of the Dashboard model.
[in]optionsAdditional options for the CTest script.
Returns:
Whether the execution of the test was successful.
Return values:
0On success.
1On failure.
function schedule_date ( )

Get next scheduled date of a given test.

Returns:
Prints date to STDOUT.
function schedule_test ( in  date,
in  time,
in  project,
in  branch,
in  model 
)

Add entry to test schedule.

Parameters:
[in]dateThe date at which the test should be run next.
[in]timeThe time at which the test should be run next.
[in]projectName of the project.
[in]branchName of the branch.
[in]modelName of the model.
Returns:
Nothing.
function stamp2date ( in  stamp)

Convert timestamp to date.

Parameters:
[in]stampTimestamp.
Returns:
Prints date corresponding to given timestamp to STDOUT.