#!/bin/sh 

# format,
#   runall clean
#   runall run

progname=$(basename $0)
pwd=`pwd`

if [ $# -eq 0 ]; then
    echo "Usage: $progname (clean|run)" >&2;
    exit 1
fi

ABAC_PROVER_PATH="/home/mei/Deter/abac/libabac"
export ABAC_PROVER_PATH

for i in `ls -1 `; do
   if [ -d $i ]; then
       cd $i
       if [ "$1" = "clean" ]; then
           rm -rf ../allout.tmp
           printf "\n ==> CLEANING on %s\n" "$i" >& 2 ;
           rm -rf *.der *.pem *.cn *.sha *.log
       elif [ "$1" = "run" ] ; then
           printf "\n ==> RUN on %s\n" "$i" >& 2;
           ./run_test
       fi 
       cd $pwd
   fi
done
