Test master which can be run as a cron job. More...
#include "${BASIS_BASH_UTILITIES}"
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] date Date.
- 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] unit Unit of the time interval. Either one of -s, -m, -h, or -d. Defaults to number of days. [in] date The date to which the time interval is added. [in] interval The time interval given in the specified units.
- Returns:
- Prints the date which is
interval
time units after the given date toSTDOUT
.
function date_diff | ( | in | unit, |
in | date1, | ||
in | date2 | ||
) |
Computes the time interval between two given dates.
- Parameters:
-
[in] unit Unit of the time interval. Either one of -s, -m, -h, or -d. Defaults to number of days. [in] date1 The first date. [in] date2 The 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] project Name of the project to test. [in] branch Name of the branch to test. [in] model Name of the Dashboard model. [in] options Additional options for the CTest script.
- Returns:
- Whether the execution of the test was successful.
- Return values:
-
0 On success. 1 On 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] date The date at which the test should be run next. [in] time The time at which the test should be run next. [in] project Name of the project. [in] branch Name of the branch. [in] model Name of the model.
- Returns:
- Nothing.
function stamp2date | ( | in | stamp | ) |
Convert timestamp to date.
- Parameters:
-
[in] stamp Timestamp.
- Returns:
- Prints date corresponding to given timestamp to
STDOUT
.