#!/bin/sh

TESTS="bt sp lu mg ep cg ft"
CLASSES="A B C"

ALL_OK=1

run_one() {
    if [ -f "$1" ]; then
        dvm run $PROC_GRID $1
        ALL_OK=$(( ALL_OK && $? == 0 ))
    else
        ALL_OK=0
    fi
}

cd bin

for tn in $TESTS; do
    for cn in $CLASSES; do
        run_one $tn.$cn.x
    done
done

if [ $ALL_OK -ne 0 ]; then
    echo " END OF NPB Benchmarks"
fi

exit 0
