Changeset 952 for trunk/test/init.sh.in


Ignore:
Timestamp:
Dec 6, 2009, 8:42:30 AM (12 years ago)
Author:
Peter Johansson
Message:

introducing init.sh and using it. Added a README file in test directory including info on how to use init.sh. refs #418

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/test/init.sh.in

    r947 r952  
    2222# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
    2323
     24exit_fail ()
     25{
     26  echo "$me: failed test: $@" 1>&2;
     27  exit 1
     28}
     29
     30exit_skip ()
     31{
     32  echo "$me: skipped test: $@"
     33  exit 77
     34}
     35
     36exit_success ()
     37{
     38  echo "$me: successsful test: $@";
     39  exit 0
     40}
     41
     42# primary variables - set by config.status
    2443abs_top_builddir=@abs_top_builddir@
    2544abs_builddir=@abs_builddir@
     45mkdir_p="@MKDIR_P@"
     46repo="@abs_test_repo@"
     47shell=@SHELL@
     48test_repo_found=@test_repo_found@
     49wc_found="@wc_found@"
     50
     51test -z "$SVNDIGEST" && SVNDIGEST="@top_builddir@/bin/svndigest --verbose";
     52test -z "$srcdir" && srcdir="@srcdir@";
     53test -z "$SVN" && SVN=svn;
     54
     55# some helpful derived variables
    2656rootdir=$abs_builddir/toy_project
    2757targetdir=$abs_builddir/generated_output
    28 
    29 test_repo_found=@test_repo_found@
    30 if test x$test_repo_found != xyes; then
    31     exit 77;
    32 fi
     58repo_url="file://$repo"
    3359
    3460while test $# -gt 0; do
     
    4167done
    4268
    43 if test -z "$VERBOSE"; then
    44   exec > /dev/null
     69# redirect output unless in verbose mode
     70test -z "$VERBOSE" && exec > /dev/null;
     71
     72me=$0
     73
     74for r in : $required; do
     75  echo $r
     76  case $r in
     77    repo*)
     78      if test x$test_repo_found = xyes; then
     79        cd $abs_builddir && $shell svn_update.sh || exit 1;
     80      else
     81        exit_skip "no test repository available";
     82      fi;;
     83    wc)
     84      if test x$wc_found = xno; then
     85        exit_skip "not subversion working copy";
     86      fi;;
     87    *)
     88    :
     89  esac
     90done
     91
     92echo "=== running $me ==="
     93
     94# turn on trace in verbose mode
     95if test -n "$VERBOSE"; then
     96  set -x;
    4597fi
    4698
    47 cd $abs_builddir && @SHELL@ svn_update.sh || exit 1;
    48 
    49 @MKDIR_P@ $targetdir;
    50 
    51 $abs_top_builddir/bin/svndigest -r $rootdir -t $targetdir \
    52 --ignore-cache --no-report --verbose;
    53 
    54 $abs_top_builddir/bin/svndigest -r $rootdir -t $targetdir -vf;
Note: See TracChangeset for help on using the changeset viewer.