head	1.4;
access;
symbols
	ansi-20040405-merged:1.3
	postmerge-20040405-ansi:1.3
	premerge-20040404-ansi:1.3
	postmerge-autoconf:1.3
	autoconf-freeze:1.3
	premerge-autoconf:1.3
	postmerge-20040315-windows:1.3
	premerge-20040315-windows:1.3
	windows-20040315-freeze:1.3
	autoconf-20031203:1.3
	autoconf-20031202:1.3
	autoconf-branch:1.3.0.12
	phong-branch:1.3.0.10
	photonmap-branch:1.3.0.8
	rel-6-1-DP:1.3
	windows-branch:1.3.0.6
	rel-6-0-2:1.3
	ansi-branch:1.3.0.4
	rel-6-0-1-branch:1.3.0.2
	hartley-6-0-post:1.3
	hartley-6-0-pre:1.3
	rel-6-0-1:1.3
	rel-6-0:1.3;
locks; strict;
comment	@# @;


1.4
date	2004.05.19.19.16.08;	author morrison;	state dead;
branches;
next	1.3;

1.3
date	2001.10.23.16.15.48;	author morrison;	state Exp;
branches;
next	1.2;

1.2
date	2001.10.12.23.11.20;	author morrison;	state Exp;
branches;
next	1.1;

1.1
date	2001.10.04.18.26.17;	author morrison;	state Exp;
branches;
next	;


desc
@@


1.4
log
@The old regression test scripts are being replaced by something else.  Likely it'll be Corredor with some unit test framework.  The old scripts are so far out of sync and so inadequate that it's simply not worth it any more.
@
text
@#!/bin/sh
#
# b u i l d
# 
# This is the BRL-CAD build test script.  It take a given source of brlcad
# and builds it.
#
###
# Source function library
. `dirname $0`/library

start ( ) {

    # acquire an architecture lock in the package source to avoid nfs clobbering.
    if ! eval "acquireLock $REGRESS_DIR/$PACKAGE_NAME/build-$ARCH 3 10 " ; then
        bomb "Unable to obtain build-$ARCH.lock"
    fi

    cd ${REGRESS_DIR}/${PACKAGE_NAME}

    ./setup.sh -s > $REGRESS_DIR/setup.log 2>&1 <<EOF
yes
EOF
    log "Setup complete"
    
    ./gen.sh -s all > $REGRESS_DIR/compilation.log 2>&1
    log "Compilation complete"
    
    ./gen.sh -s install > $REGRESS_DIR/installation.log 2>&1
    log "Installation complete"

    releaseLock $REGRESS_DIR/$PACKAGE_NAME/build-$ARCH
}


status ( ) {
    if [ ! -f $REGRESS_DIR/build.log ] ; then
        warn "build did not run"
        return 1
    fi
    if [ ! -f $REGRESS_DIR/setup.log ] ; then
        warn "build no setup log"
        return 1
    fi
    if [ ! -f $REGRESS_DIR/compilation.log ] ; then
        warn "build no compilation log"
        return 1
    fi
    if [ ! -f $REGRESS_DIR/installation.log ] ; then
        warn "build no installation log"
        return 1
    fi

    if [ ! "x`grep -i error $REGRESS_DIR/setup.log`" = "x" ] ; then
        warn "build Setup failed"
        return 1
    fi
    if [ ! "x`grep -i \"no such file\" $REGRESS_DIR/setup.log`" = "x" ] ; then
        warn "build Setup failed"
        return 1
    fi

    if [ ! "x`grep Error $REGRESS_DIR/compilation.log`" = "x" ] ; then
        warn "build Compilation failed"
        return 1
    fi
    if [ ! "x`grep -i \"no such file\" $REGRESS_DIR/compilation.log`" = "x" ] ; then
        warn "build Compilation failed"
        return 1
    fi

    if [ ! "x`grep Error $REGRESS_DIR/installation.log`" = "x" ] ; then
        warn "build Installation failed"
        return 1
    fi
    if [ ! "x`grep -i \"no such file\" $REGRESS_DIR/installlation.log`" = "x" ] ; then
        warn "build Installation failed"
        return 1
    fi
    log "build OK"
    return 0
}


regress $1

exit $?@


1.3
log
@finally completed default regress behaviour
@
text
@@


1.2
log
@*** empty log message ***
@
text
@a11 9
# use machinetype.sh's naming convention instead of the default name we get
# from uname
if [ -f "${REGRESS_DIR}/${PACKAGE_NAME}/sh/machinetype.sh" ] ; then
    mt="`${REGRESS_DIR}/${PACKAGE_NAME}/sh/machinetype.sh > /dev/null 2>&1`"
    [ $? = 0 ] && ARCH="$mt"
fi
initializeVariable BRLCAD_ROOT "${REGRESS_DIR}/${PACKAGE_NAME}.${ARCH}"


a18 5
    __PATH="$PATH"
    PATH="${BRLCAD_ROOT}/bin:$PATH" ; export PATH

    STARTPWD="`pwd`"
    
a30 4

    # restore to previous state
    cd $STARTPWD
    PATH="$__PATH" ; export PATH
@


1.1
log
@added new test scripts
@
text
@d3 4
a6 1
# This is the initial build app
d8 1
a8 1

d12 5
a16 12
initializeVariable PACKAGE_NAME brlcad
# if regress_dir was not set, default to the package that this script is included with
if [ "x$REGRESS_DIR" = "x" ] ; then
    if [ -d "$LPWD/../../$PACKAGE_NAME" ] ; then
        initializeVariable REGRESS_DIR "$LPWD/../.."
    elif [ -d "$LPWD/../$PACKAGE_NAME" ] ; then
        initializeVariable REGRESS_DIR "$LPWD/.."
    elif [ -d "$LPWD/$PACKAGE_NAME" ] ; then
        initializeVariable REGRESS_DIR "$LPWD"
    else
        bomb "Unable to locate $PACKAGE_NAME"
    fi
a17 3
__ARCH="$ARCH"
initializeVariable ARCH `${REGRESS_DIR}/brlcad/sh/machinetype.sh`
initializeVariable ARCH "$__ARCH"
a52 6
stop ( ) {
    bomb "stop unimplemented"
    killall build
    killall sh
    killall cake
}
d103 1
a103 18
case "$1" in
    start )
        start
        ;;
    stop )
        stop
        ;;
    restart )
        stop
        start
        ;;
    status )
        status
        ;;
    * )
        log "Usage: $0 {start|stop|restart|status}"
        exit 1
esac
@

