#!/bin/bash
-function runtests {
- pushd .
+
+function runtest {
+ pushd . > /dev/null
cd "`dirname "$0"`"
for testno in *
do
if [ -d $testno ]; then
- runtest $testno
+ _runtest $testno
fi
done;
- popd
+ popd > /dev/null
}
-function runtest {
- pushd .
- cd ../code/
- _runtest $1 ethernet
- _runtest $1 moose
- popd
+function _runtest {
+ __runtest $1 ethernet
+ __runtest $1 moose
}
-function _runtest {
- mkdir -p ../simulations/$1/$2
- ./waf --run "simulation --network=../simulations/$1/topology --data=../simulations/$1/data --csma=../simulations/$1/$2/csma --ip=../simulations/$1/$2/ip --pcap=../simulations/$1/$2/pcap --link=$2 --state=../simulations/$1/$2/state"
+function __runtest {
+ ___runtest $1 $2 static
+ ___runtest $1 $2 dynamic
+}
+
+function ___runtest {
+ pushd . > /dev/null
+ cd "`dirname "$0"`/../code/"
+ mkdir -p ../simulations/$1/$2/$3
+ ./waf --run "simulation --network=../simulations/$1/topology --data=../simulations/$1/data --csma=../simulations/$1/$2/$3/csma --ip=../simulations/$1/$2/$3/ip --pcap=../simulations/$1/$2/$3/pcap --link=$2 --state=../simulations/$1/$2/$3/state --routing=$3"
+ popd > /dev/null
}
# Tests
-runtests
+if [ $# == 3 ]; then
+ ___runtest $1 $2 $3
+ exit
+fi
+
+if [ $# == 2 ]; then
+ __runtest $1 $2
+ exit
+fi
+
+if [ $# == 1 ]; then
+ _runtest $1
+ exit
+fi
+
+if [ $# == 0 ]; then
+ runtest
+ exit
+fi
+
+echo "Usage: $0 [ test [ linklayer [ routing ] ] ]"
+exit