view scripts/test.sh @ 1359:fa1a3b9eed6f draft

Tweak license page to explicitly say that zero clause BSD is functionally equivalent to placing the code in the public domain. This license variant looks like BSD, but is an unrestricted permission grant that doesn't require you to copy specific license text into derivative works. (The second paragraph is about something we DON'T do, I.E. provide any sort of warantee, and is just boilerplate from BSD to make it look like a BSD license.)
author Rob Landley <rob@landley.net>
date Tue, 24 Jun 2014 07:00:13 -0500
parents 55a533fa5039
children 7dd487ddd7dc
line wrap: on
line source

#!/bin/bash

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

rm -rf testdir
mkdir -p testdir

if [ -z "$TEST_HOST" ]
then
  if [ $# -ne 0 ]
  then
    PREFIX=testdir/ scripts/single.sh "$@" || exit 1
  else
    make install_flat PREFIX=testdir || exit 1
  fi
fi

cd testdir
PATH="$(pwd):$PATH"

. "$TOPDIR"/scripts/test/testing.sh
[ -f "$TOPDIR/generated/config.h" ] && export OPTIONFLAGS=:$(echo $(sed -nr 's/^#define CFG_(.*) 1/\1/p' "$TOPDIR/generated/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