Add script to run tests
authorRichard Whitehouse <github@richardwhiuk.com>
Mon, 18 Apr 2011 13:18:58 +0000 (14:18 +0100)
committerRichard Whitehouse <github@richardwhiuk.com>
Mon, 18 Apr 2011 13:18:58 +0000 (14:18 +0100)
run [new file with mode: 0755]

diff --git a/run b/run
new file mode 100755 (executable)
index 0000000..28c7fc5
--- /dev/null
+++ b/run
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+function runtests {
+       pushd .
+       cd "`dirname "$0"`"
+       for testno in *
+       do
+               if [ -d $testno ]; then
+                       runtest $testno
+               fi
+       done;
+       popd
+}
+
+function runtest {
+       pushd .
+       cd ../code/
+       _runtest $1 ethernet
+       _runtest $1 moose
+       popd
+}
+
+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"
+}
+
+# Tests
+
+runtests
+