-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify.sh
93 lines (86 loc) · 1.72 KB
/
verify.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
unset -v file arg1 arg2
run=false
all=false
excluded=""
files=""
alloc_policy=2
num_frames=16
while getopts raf:e: flag
do
case "${flag}" in
r) run=true;; #Run flag
a) all=true;; #All flag
f) files=${OPTARG};; #Specific file flag
e) excluded=${OPTARG};; #Exclude file flag
esac
done
shift $(( OPTIND - 1 ))
excluded=($excluded)
if [[ ! $1 == '' ]]
then
alloc_policy=$1
fi
if $run
then
if $all
then
#RUN ALL SCRIPTS BUT EXCLUDED
make clean; make; sleep 2; clear;
for i in {1..12}
do
if ! printf '%s\0' "${excluded[@]}" | grep -F -x -z -q -- $i
then
echo "Starting Input $i"
echo
sleep 0.5;
./proj3 $alloc_policy $num_frames sample_input/input_$i
echo "----"
fi
done
else
#RUN SPECIFIED SCRIPTS
make clean; make; sleep 2; clear;
for i in $files
do
if ! printf '%s\0' "${excluded[@]}" | grep -F -x -z -q -- $i
then
echo "Starting Input $i"
echo
sleep 0.5;
./proj3 $alloc_policy $num_frames sample_input/input_$i
echo "----"
fi
done
fi
else
#VERIFY CASES
if $all
then
#VERIFY ALL SCRIPTS BUT EXCLUDED
for i in {1..12}
do
if ! printf '%s\0' "${excluded[@]}" | grep -F -x -z -q -- $i
then
DIFF=$(diff output/result-$alloc_policy-$num_frames-input_$i sample_output/result-$alloc_policy-$num_frames-input_$i)
if [ "$DIFF" == "" ]
then
echo "TEST $i PASSED"
else
echo "|> TEST $i FAILED"
fi
fi
done
else
#VERIFY SPECIFIED SCRIPTS
for i in $files
do
DIFF=$(diff output/result-$alloc_policy-$num_frames-input_$i sample_output/result-$alloc_policy-$num_frames-input_$i)
if [ "$DIFF" == "" ]
then
echo "TEST $i PASSED"
else
echo "|> TEST $i FAILED"
fi
done
fi
fi