-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathruntests.sh
39 lines (35 loc) · 932 Bytes
/
runtests.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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Function to display usage instructions
usage() {
echo "Usage: $0 [option]"
echo "Options:"
echo " all Run all tests (default)"
echo " mutation Run only mutation tests"
echo " parsing Run only parsing tests"
exit 1
}
# Default to "all" if no argument is provided
if [ $# -eq 0 ]; then
set -- "all"
fi
# Handle the provided option
case $1 in
all)
echo "Running all tests..."
python -m unittest discover -s test -p "test_*.py" -v
;;
mutation)
echo "Running mutation tests..."
python -m unittest discover -s test -p "test_mutation*.py" -v
;;
parsing)
echo "Running parsing tests..."
python -m unittest discover -s test -p "test_parsing*.py" -v
;;
*)
echo "Invalid option: $1"
usage
;;
esac