#! /bin/bash # $Id$ #{{{ docu # # runfex - run factory example collection. # #}}} set -o nounset set -o noglob trap signalHandlerInterrupt SIGINT trap signalHandlerQuit SIGQUIT # # - functions. # #{{{ signalHandlerInterrupt (), signalHandlerQuit () #{{{ docu # # signalHandler*() - catch signals. # #}}} signalHandlerInterrupt() { warn "received signal SIGINT" exit } signalHandlerQuit() { warn "received signal SIGQUIT" exit } #}}} #{{{ warn () #{{{ docu # # warn() - print arguments to stderr prefixed by ExecName. # # ExecName (global constant): name of the shell script # being executed # #}}} readonly ExecName="$0" warn() { echo "$ExecName:" "${@-}" >&2 } #}}} #{{{ usage () usage() { echo " Usage: runfex [] [] [] [] Runs all examples in matching . should be regular shell patterns, which may be preceded by a \`^' to exclude all examples matching . When run in foreground, SIGQUIT immediately interrupts \`runfex', while SIGINT only interrupts the example currently being calculated. In background, SIGTERM interrupts \`runfex' after the current example has been finished. : -d: debug mode. In debug mode, examples are echoed to stdout instead of being executed. -C : specifies which object/executable configuration to use. Defaults to \`opt'. -t: do not run checks Besides from regular shell commands, the commands \`collection' and \`example' may be used in a Factory example file. \`collection' specifies options and environment common to a collection of examples, \`example' defines an example. collection [] [] [] example [] [] [] /: -n : specifies comment on the collection/example : -a