#!/bin/sh

set -e

cudfin=examples/legacy.cudf
cudfout=$TMPDIR/legacy.sol
check=$TMPDIR/legacy.rep

for solver in "" "-lpsolve"
do
    mccs -i $cudfin -o $cudfout $solver
    cudf-check -cudf $cudfin -sol $cudfout > $check 2> /dev/null
    if [ `grep -c "is_solution: true" $check` -ne 1 ]
    then
	echo "Test \"legacy\" with options \"$solver\":"
	cat $check
	exit 1
    fi
done

exit 0
