#!/bin/csh -f
#
# makeptests - make a long script to run many test files, for procs variation
#  This script can then be run using rpl's runsuite program.
# 
# usage:
#   makeptests [-elog] testfile...
#
# output is to stdout. The -elog argument is passed on to driver.
#
# The number of processors needed is found by scanning the path name
# for a component that is only a number; eg test/procs/10/gpr needs
# 10 procs.

if ($#argv == 0) then
    echo usage: 'makeptests [-elog] testfile...'
    exit 1
endif

if ("$1" =~ -*) then
    set opt="$1"
    shift
else
    set opt=""
endif

echo 'echo > script'
foreach i ($*)
    	   set procs=`echo $i | sed 's+.*/\([0-9]*\)/.*+\1+'`
	   echo runtest $procs $opt $i '>> script 2>&1'
end


