From b549e4903dd8d3df5197fd1a025ee68b8d6b2da7 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 3 Aug 2005 06:24:28 +0000 Subject: r8992: More make test work. Adding a way to order tests (might change my mind on this later). (This used to be commit 136fe3f15e74686882f7c1e5a46fcc0bcf7d51a6) --- source3/script/tests/functions | 4 ++++ source3/script/tests/runtests.sh | 27 ++++++++++++++++++++------- source3/script/tests/t_001.sh | 30 ++++++++++++++++++++++++++++++ source3/script/tests/t_listing.sh | 28 ---------------------------- 4 files changed, 54 insertions(+), 35 deletions(-) create mode 100644 source3/script/tests/functions create mode 100644 source3/script/tests/t_001.sh delete mode 100644 source3/script/tests/t_listing.sh (limited to 'source3/script/tests') diff --git a/source3/script/tests/functions b/source3/script/tests/functions new file mode 100644 index 0000000000..0969c98724 --- /dev/null +++ b/source3/script/tests/functions @@ -0,0 +1,4 @@ +## +## library file for test functions +## + diff --git a/source3/script/tests/runtests.sh b/source3/script/tests/runtests.sh index 2483de97ca..6ee6d3a32b 100644 --- a/source3/script/tests/runtests.sh +++ b/source3/script/tests/runtests.sh @@ -1,21 +1,28 @@ #!/bin/sh -DOMAIN=SAMBA-TEST -export DOMAIN - if [ "x$1" == "x" ]; then echo "$0 " exit 1 fi +## +## create the test directory +## PREFIX=`echo $1 | sed s+//+/+` - mkdir -p $PREFIX || exit $? OLD_PWD=`pwd` cd $PREFIX || exit $? export PREFIX_ABS=`pwd` cd $OLD_PWD +## +## setup the various environment variables we need +## + +DOMAIN=SAMBA-TEST + +SRCDIR=`pwd` +SCRIPTDIR=$SRCDIR/script/tests TMPDIR=$PREFIX_ABS/tmp LIBDIR=$PREFIX_ABS/lib PIDDIR=$PREFIX_ABS/pid @@ -31,11 +38,17 @@ PATH=`pwd`/bin:$PATH rm -rf $PREFIX/* mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $LOCKDIR $TMPDIR $LOGDIR $SOCKET_WRAPPER_DIR -export PREFIX_ABS CONFIGURATION CONFFILE PATH SOCKET_WRAPPER_DIR +export PREFIX_ABS CONFIGURATION CONFFILE PATH SOCKET_WRAPPER_DIR DOMAIN export PRIVATEDIR LIBDIR PIDDIR LOCKDIR TMPDIR LOGDIR +export SRCDIR SCRIPTDIR -cd script/tests -for testfile in t_*sh; do +for testfile in `ls $SCRIPTDIR/t_*sh | sort`; do + echo ">>>>>> Starting test driver `basename $testfile` <<<<<" sh $testfile + if [ $? = 0 ]; then + echo ">>>>> test ok <<<<<" + else + echo ">>>>> test failed <<<<<" + fi done diff --git a/source3/script/tests/t_001.sh b/source3/script/tests/t_001.sh new file mode 100644 index 0000000000..86837050c7 --- /dev/null +++ b/source3/script/tests/t_001.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +. $SCRIPTDIR/functions + +cat >$CONFFILE<$CONFFILE<