#! /bin/bash set -e gl_package_name="modxslt" gl_abs_srcdir="@abs_srcdir@" gl_testdir="../tests" gl_inline_tree="../tree" # Try to avoid strange tricks with # patsh (get any help we may have from configure) case $gl_abs_srcdir in @*@) gl_abs_srcdir="$(dirname $(readlink -f $(which $0)))" ;; esac cd "$gl_abs_srcdir" if which fakeroot &>/dev/null; then fake=`which fakeroot` else test "x$UID" = "x0" || { echo "You must be root!" exit 1 } fi usage="\ Usage: ${gl_package_name}-test (try [TEST [PARAMS]]|list|help [TEST]) try TEST [PARAMS] perform the test named TEST using the specifyed parameters gen TEST [PARAMS] generate the output expected by TEST using the specifyed parameters (maintainer only) compile TEST prebuild binaries needed by test TEST clean cleanup the whole build tree clean-lib cleanup any binary generated to compile the library tree clean-test [TEST] cleanup any binary generated to perform the indicated test (or all tests) list list all available tests help [TEST] Output this help screen. If followed by the name of a TEST, the specific help page for the named TEST is outputted 'list' and 'help' are considered 'terminal' commands. Any command after a 'list' or a 'help' is ignored. More than one 'try' can be specifyed on the same command line. Exit status: 1 - No arguments - help screen was displayed 2 - Unknown command was requested 3 - Missing parameter 4 - Test files do not exist or are not accessible (test was not performed)" if test "$#" -eq 0; then echo "${usage}" exit 1 fi if test "$#" -gt 1; then _rt_output_name="yes" fi while test $# -gt 0; do case "$1" in try) shift if test "x$1" = "x"; then echo "Missing parameter for 'try' command. Expecting 'TEST'." 1>&2 echo "${usage}" exit 3 fi . test.try ;; gen) shift if test "x$1" = "x"; then echo "Missing parameter for 'gen' command. Expecting 'TEST'." 1>&2 echo "${usage}" exit 3 fi . test.gen ;; list) shift . test.list exit 0 ;; help) shift if test "x$1" = "x"; then echo "$usage" else . test.help.module fi exit 0 ;; *) echo "Unknown command: '$1'" 1>&2 echo "${usage}" exit 2 ;; esac done