view scripts/test.sh @ 291:620a2eab6b82

More tweaks to rmdir.test and the testing infrastructure.
author Rob Landley <rob@landley.net>
date Sun, 04 May 2008 19:44:39 -0500
parents 977302071875
children 8f481b23138b
line wrap: on
line source

#!/bin/bash

[ -z "$TOPDIR" ] && TOPDIR="$(pwd)"

rm -rf testdir
mkdir -p testdir

if [ -z "$TEST_HOST" ]
then
  make install_flat PREFIX=testdir || exit 1
fi

cd testdir
PATH=.:$PATH

. "$TOPDIR"/scripts/test/testing.sh
[ -f "$TOPDIR/gen_config.h" ] && export OPTIONFLAGS=:$(echo $(sed -nr 's/^#define CFG_(.*) 1/\1/p' "$TOPDIR/gen_config.h") | sed 's/ /:/g')

if [ $# -ne 0 ]
then
  for i in "$@"
  do
    . "$TOPDIR"/scripts/test/$i.test
  done
else
  for i in "$TOPDIR"/scripts/test/*.test
  do
    CMDNAME="$(echo "$i" | sed 's@.*/\(.*\)\.test@\1@')"
    if [ -h $CMDNAME ] || [ ! -z "$TEST_HOST" ]
    then
      . $i
    else
      echo "$CMDNAME disabled"
    fi
  done
fi