#!/bin/sh
#
# This is a simple script that tests multimix
#
# install as: /usr/lib/debian-test/tests/multimix
# or else as: /usr/lib/debian-test/tests/multimix/test-1
# In the latter case, /usr/lib/debian-test/tests/multimix/ can contain
# other file with test data and/or other scripts named test-2, test-3, etc.
#
# You can run this script with the command
#       sh debian/tests
# After installation, you can run it with the commands
#       /usr/lib/debian-test/tests/multimix
# or
#       debian-test -v multimix
# see debian-test(1)

. ${DEBIANTEST_LIB:-/usr/lib/debian-test/lib}/functions.sh

if [ -f my-data-file ]; then
    TESTDIR=`pwd`;
else
    TESTDIR=/usr/lib/debian-test/tests/multimix;
fi


## we need a scratch directory in which to execute

TMP=/tmp/multimix-test.$$
test -e $TMP && rm -rf $TMP
mkdir $TMP
cd $TMP
trap "rm -rf $TMP" EXIT

test1(){
    RESULT=0
    cp /usr/share/doc/multimix/examples/* .
    sh simple.README
    if grep -q "XING PROPORTION IN GROUP   2 IS 0.66819" GENERAL.OUT; then 
	true; 
    else 
	RESULT=1; 
    fi

    return $RESULT
}

runtest "simple test case" test1

