view smoketest-all.sh @ 810:4cfa8c130605

Brown paper bag bug: setting HOST_BUILD_EXTRA or using ./download.sh --extract causes a build break. The regex in the shell function noversion doesn't recognize two consecutive letters as part of a legitimate version name, so qemu-2d18e637e5ec.tar.bz2 should actually be qemu-2d18e637e5e.tar.bz2 in order to be recognized as "qemu". (That's using the git commit ID as the version, which would have worked if I'd cut it in the right place.) I forgot that ./buildall.sh doesn't use ./download.sh --extract anymore, so of course it didn't catch this.
author Rob Landley <rob@landley.net>
date Fri, 21 Aug 2009 22:56:13 -0500
parents 23bff7aa79eb
children
line wrap: on
line source

#!/bin/bash

. 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="$(./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 -pd build/system-image-* | sed -n 's@.*/system-image-\(.*\)/@\1@p' | grep -v "^hw-")
do
  maybe_fork "dotest $i"
done

wait