1#! /bin/sh
2# $Id: test-prop-config 196 2006-03-25 13:35:20Z sfsetse $
3#
4# Author: Kate Ward <kate.ward@forestent.com>
5#
6
7# find myself
8whoAmI=`basename $0`
9whereAmI=`dirname $0`
10whereAmI=`cd "${whereAmI}" 2>/dev/null && pwd || echo "${whereAmI}"`
11
12#-----------------------------------------------------------------------------
13# functions
14#
15
16test_cleanup()
17{
18  echo '### test script cleanup function called###'
19}
20
21loadLog4sh()
22{
23  config="$1"
24
25  if [ -r log4sh ]; then
26    LOG4SH_CONFIGURATION="${config}" . ./log4sh
27  else
28    echo "ERROR: could not load (log4sh)" >&2
29    exit 1
30  fi
31  logger_trace "whoAmI=${whoAmI} whereAmI=${whereAmI}"
32}
33
34#-----------------------------------------------------------------------------
35# pre-configure log4sh
36#
37# the functions called in this section are meant to exactly reproduce what the
38# runtime configuration test script does so that the common tests that are run
39# generate the same output.
40
41configLog4sh()
42{
43  :
44}
45
46#-----------------------------------------------------------------------------
47# main
48#
49
50# setup trap handler.  must be done before loading log4sh
51trap 'test_cleanup' EXIT
52
53# load and configure log4sh
54loadLog4sh
55configLog4sh
56
57# load and run the common tests
58commonTests='test-common'
59if [ -r "${commonTests}" ]; then
60  . ${whereAmI}/${commonTests}
61else
62  logger_fatal "could not load the common tests"
63  exit 1
64fi
65