#!/bin/sh
#
# Copyright (C) 2004-2006
#           Michael Maurer <mjmaurer@yahoo.com>
#           Brian Goetz <brian@quiotix.com>
#           Tim Showalter <tjs@psaux.com>
#           Loic Dachary <loic@dachary.org>
#
#
# This program gives you software freedom; you can copy, convey,
# propagate, redistribute and/or modify this program under the terms of
# the GNU General Public License (GPL) as published by the Free Software
# Foundation (FSF), either version 3 of the License, or (at your option)
# any later version of the GPL published by the FSF.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program in a file in the toplevel directory called "GPLv3".
# If not, see <http://www.gnu.org/licenses/>.
#
#

set -e

case "$1" in 


*gcov-report) 
        #
        # make CC=gcc check is mandatory for the gcov output to be
        # generated (options + ccache disable gcov output)
        #
        ;;

*enumtest1)
        [ $(./enumtest1 6 3 | /usr/bin/md5sum | /usr/bin/awk '{print $1}') = 425daf38998180d6f261ac6801d589dd ] 
        ;;

*enumtest2)
        [ $(./enumtest2 | /usr/bin/md5sum | /usr/bin/awk '{print $1}') = 1e144704f542b3046c174bcfc3c1f2a2 ]  
        ;;

*enumtest3)
        [ $(./enumtest3 | /usr/bin/md5sum | /usr/bin/awk '{print $1}') = 8eca9e9a0aa0e4ad71acafbc8a93da4a ]  
        ;;

*enumtest5)
        [ $(./enumtest5 | /usr/bin/md5sum | /usr/bin/awk '{print $1}') = 74c0f1347023859feab2275dc8c33ef1 ]  
        ;;

*enumtest7)
        [ $(./enumtest7 | /usr/bin/md5sum | /usr/bin/awk '{print $1}') = 02d548445d51f7ddf2b99ff878b49277 ]  
        ;;

*joktest1)
        ./joktest1 > /dev/null  
        ;;

*razz)
        ./razz
        ;;

*poker_wrapper)
        ./poker_wrapper
        ;;

*bug*)
        $1
        ;;

*)
        echo "unknown test $1"
        exit 1
        ;;

esac

