view more/smoketest-all.sh @ 1178:80693b1a8038

Yank toybox from simple-root-filesystem. (Still need it for patch in host-tools.sh)
author Rob Landley <rob@landley.net>
date Mon, 26 Jul 2010 00:06:58 -0500
parents 300e6d919d86
children ce5212c0fc05
line wrap: on
line source

#!/bin/bash

# Run smoketest script on every build/system-image-* architecture.

# If $FORK is set, run them in parallel.

. sources/functions.sh || exit 1

if [ "$1" == "--logs" ]
then
  for i in build/logs/smoketest-*.txt
  do
    NAME="$(echo $i | sed 's/.*smoketest-\(.*\)\.txt/\1/')"
    echo -n "Testing $NAME:"
    RESULT="$(grep 'Hello world!' "$i")"
    [ -z "$RESULT" ] && echo "FAIL" || echo "PASS"
  done

  exit
fi

function dotest()
{
  [ -z "$FORK" ] && echo -n "Testing $1:"
  [ ! -z "$VERBOSE" ] && VERBOSITY="tee >(cat >&2) |"
  RESULT="$(more/smoketest.sh "$1" 2>&1 | eval "$VERBOSITY grep 'Hello world!'")"
  [ -z "$RESULT" ] && RESULT="FAIL" || RESULT="PASS"
  [ -z "$FORK" ] && echo "$RESULT" || echo "Testing $1:$RESULT"
  rm -f build/system-image-"$1"/hdb.img 2>/dev/null
}

# Test all non-hw targets to see whether or not they can compile and run
# the included "hello world" program.

for i in $(ls -d sources/targets/* | sed 's@.*/@@' | grep -v "^hw-")
do
  if [ -e "build/system-image-$i" ]
  then
    maybe_fork "dotest $i"
  else
    echo "Testing $i:NONE"
  fi
done

wait