-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_test.sh
More file actions
executable file
·51 lines (48 loc) · 1.21 KB
/
Copy pathrun_test.sh
File metadata and controls
executable file
·51 lines (48 loc) · 1.21 KB
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
#!/bin/bash
TEST="./target/assignment3"
usage() {
echo "Usage: $0 [option]"
echo "Options:"
echo " -1 Run test that creates N cars of the same team"
echo " -2 Run test that creates N+1 cars of the same team"
echo " -3 Run test that creates N+1 cars of both teams"
echo " -4 Run test that creates N+1 cars of both teams but in groups"
echo " -5 Run test that creates 1 car"
exit 1
}
if [ $# -eq 0 ]; then
usage
fi
while getopts ":12345" opt; do
case $opt in
1)
make
echo "Running with the 1st test"
$TEST 5 < ./tests/1.txt
;;
2)
make
echo "Running with the 2nd test"
$TEST 5 < ./tests/2.txt
;;
3)
make
echo "Running with the 3rd test"
$TEST 5 < ./tests/3.txt
;;
4)
make
echo "Running with the 4th test"
$TEST 5 < ./tests/4.txt
;;
5)
make
echo "Running with the 5th test"
$TEST 2 < ./tests/5.txt
;;
\?)
echo "Invalid option: -$OPTARG"
usage
;;
esac
done