#!/bin/sh
##
##  fulltest -- Runs a full MM test suite on a platform
##  Copyright (c) 1999 Ralf S. Engelschall, All Rights Reserved. 
##

LOG="$0.log"
touch $LOG
OS=`./config.guess`
OS=`./config.sub $OS`

testit () {
    echo dummy | awk '{ printf("%s ... ", STR); }' STR="$OS: $*"
    make distclean >/dev/null 2>&1
    rm -f config.cache >/dev/null 2>&1
    ./configure $* --disable-shared >>$LOG 2>&1
    if [ $? -ne 0 ]; then
        echo "Failed (configuration)"
        tail -4 $LOG | sed -e 's;^;| ;'
        continue;
    fi
    make >>$LOG 2>&1
    if [ $? -ne 0 ]; then
        echo "Failed (compilation)"
        tail -4 $LOG | sed -e 's;^;| ;'
        continue;
    fi
    make test >>$LOG 2>&1
    if [ $? -ne 0 ]; then
        echo "Failed (runtime)"
        tail -4 $LOG | sed -e 's;^;| ;'
        continue;
    fi
    echo "Ok"
}

for shm in MMFILE MMZERO MMPOSX MMANON IPCSHM; do
    testit --with-shm=$shm
done
for sem in FLOCK FCNTL IPCSEM; do
    testit --with-sem=$sem
done

