#!/bin/sh
###############################################################################
#                                                                             #
#  TakTuk, a middleware for adaptive large scale parallel remote executions   #
#  deployment. Perl implementation, copyright(C) 2006 Guillaume Huard.        #
#                                                                             #
#  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 for more details.                               #
#                                                                             #
#  You should have received a copy of the GNU General Public License          #
#  along with this program; if not, write to the Free Software                #
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA #
#                                                                             #
#  Contact: Guillaume.Huard@imag.fr                                           #
#           ENSIMAG - Laboratoire ID                                          #
#           51 avenue Jean Kuntzmann                                          #
#           38330 Montbonnot Saint Martin                                     #
#                                                                             #
###############################################################################

set -e

NUM="$1"
IN="$2"
sed -e '/[^#]/,$d' < "$0"
echo "set -e"
echo ". ../functions.sh"
echo ""
echo "echo '*** $(sed -e "s/^0:TITLE://p;d" < "$IN") '\"\${1:+(\$1) }\"'***'"
echo "echo '*** TEST$NUM: $(sed -e "s/^$NUM:TITLE://p;d" < "$IN")'"
sed -e "s/^0:CMD://p;d" < "$IN"
sed -e "s/^$NUM:CMD://p;d" < "$IN"

