#!/bin/sh

# Open-MX
# Copyright © inria 2007-2010 (see AUTHORS file)
#
# The development of this software has been funded by Myricom, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# 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 in COPYING.GPL for more details.

scriptpath=`readlink -f $0`
scriptdir=`dirname $scriptpath`

BATTERY_LIST='loopback misc vect pingpong'

find_battery()
{
    if [ -f $1/Makefile ] ; then
	BATTERY_DIR="$1/../tests/battery"
    else
	BATTERY_DIR="$2/bin/tests/battery"
    fi
}

find_battery $scriptdir /usr/open-mx

for b in $BATTERY_LIST ; do $BATTERY_DIR/$b ; done
