diff --git a/source/Makefile.in b/source/Makefile.in index 4c5fbb27739..21e19237691 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -776,7 +776,7 @@ pch: ## test: all @echo Running Samba 3 Test suite - sh ./script/tests/runtests.sh t_dir + @sh ./script/tests/runtests.sh t_dir # These dependencies are only approximately correct: we want to make diff --git a/source/script/tests/functions b/source/script/tests/functions new file mode 100644 index 00000000000..0969c987240 --- /dev/null +++ b/source/script/tests/functions @@ -0,0 +1,4 @@ +## +## library file for test functions +## + diff --git a/source/script/tests/runtests.sh b/source/script/tests/runtests.sh index 2483de97caf..6ee6d3a32bf 100644 --- a/source/script/tests/runtests.sh +++ b/source/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/source/script/tests/t_listing.sh b/source/script/tests/t_001.sh similarity index 95% rename from source/script/tests/t_listing.sh rename to source/script/tests/t_001.sh index 06898076716..86837050c70 100644 --- a/source/script/tests/t_listing.sh +++ b/source/script/tests/t_001.sh @@ -1,5 +1,7 @@ #!/bin/sh +. $SCRIPTDIR/functions + cat >$CONFFILE<