]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blob - scripts/test_all_scenarios.sh
Include average iterations in plot title
[hubacji1/iamcar2.git] / scripts / test_all_scenarios.sh
1 # Run `runnable` binary for all the scenarios and safe the plans to the
2 # `results` folder.
3 #
4 # This script should be run from the `build` folder as:
5 #
6 #       bash ../scripts/test_all_scenarios.sh test1 1000 ../scenarios/ out
7 #
8 if [ $# -ne 4 ]
9 then
10         echo 'Test `runnable` for all the scenarios'
11         echo ''
12         echo 'Usage:'
13         echo ''
14         echo -e '\tbash test_all_scenarios.sh RUNNABLE COUNT SCENARIOS RESULTS'
15         echo ''
16         echo '- RUNNABLE is runnable binary.'
17         echo '- COUNT is number of runs for each scenario.'
18         echo '- SCENARIOS is the directory with scenarios.'
19         echo '- RESULTS is the directory to store the results to.'
20         exit 1
21 fi
22 runnable=$1
23 count=$2
24 scenarios=$3
25 results=$4
26
27 if [ ! -d $results ]
28 then
29         mkdir $results
30 fi
31
32 cnt=0
33 while [ $cnt -lt $count ]
34 do
35         mkdir $results/$cnt
36         for sc in `ls $scenarios`
37         do
38                 ./$runnable < $scenarios/$sc > $results/$cnt/$sc
39         done
40         cnt=$(( $cnt + 1 ))
41 done