Test master which can be run as a cron job. More...
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 | realpath (in path) |
Get real path of given file or directory. | |
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. |
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 date2stamp | ( | in | date | ) |
Convert date to timestamp.
[in] | date | Date. |
STDOUT
. function date_add | ( | in | unit, |
in | date, | ||
in | interval | ||
) |
Adds a certain time interval to a given date.
[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. |
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.
[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. |
STDOUT
. function print_help | ( | ) |
Print help.
function print_helpshort | ( | ) |
Print usage (i.e., only usage and options).
function print_options | ( | ) |
Print documentation of options.
function realpath | ( | in | path | ) |
Get real path of given file or directory.
Example:
exec_dir=`realpath $0`
[in] | path | File or directory path. |
function run_test | ( | in | project, |
in | branch, | ||
in | model, | ||
in | options | ||
) |
Runs a test given the arguments in the configuration file.
[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. |
0 | On success. |
1 | On failure. |
function schedule_date | ( | ) |
Get next scheduled date of a given test.
STDOUT
. function schedule_test | ( | in | date, |
in | time, | ||
in | project, | ||
in | branch, | ||
in | model | ||
) |
Add entry to test schedule.
[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. |
function stamp2date | ( | in | stamp | ) |
Convert timestamp to date.
[in] | stamp | Timestamp. |
STDOUT
.