-
Notifications
You must be signed in to change notification settings - Fork 0
/
jitx.sh
83 lines (79 loc) · 2.7 KB
/
jitx.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
#!/bin/bash
# This script is to execute the automated pytest test cases
usage() {
echo "This script is to execute the automated pytest test cases"
echo "usage: $0 test_case_dir_path test_case_dir_name"
echo "arguments:"
echo " test_case_dir_path - path to the directory where all the test case folders are present"
echo " test_case_dir_name - (optional) To run the test cases in a particular directory"
echo " e.g:"
echo " $0 /myvol/qa/"
echo " $0 /myvol/qa/ Exporter-QA"
echo " $0 /myvol/qa/ Importer-QA"
echo " $0 /myvol/qa/ JITX-QA"
echo " $0 /myvol/qa/ OCDB-QA"
echo " $0 /myvol/qa/ Roundtrip-QA"
echo " $0 /myvol/qa/ Schematic-QA"
exit 1
}
# Checking Platform
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=Windows;;
*) machine="UNKNOWN:${unameOut}"
esac
# Script Validation
if [[ $# -ne 1 && $# -ne 2 ]]; then
echo "Invalid number of arguments"
usage
fi
# Executing the test cases
if [ $# -eq 1 ]; then
dir_path="$1""Exporter-QA"
cd $dir_path
pytest test_exporter_jitx.py --html="Exporter_$machine.html"
cd ../Importer-QA
pytest test_importer_jitx.py --html="Importer_$machine.html"
cd ../JITX-QA
pytest test_jitxqa_jitx.py --html="JITX_$machine.html"
cd ../OCDB-QA
pytest test_ocdb_jitx.py --html="OCDB_$machine.html"
cd ../Roundtrip-QA
pytest test_roundtrip_jitx.py --html="Roundtrip_$machine.html"
cd ../Schematic-QA
pytest test_schematic_jitx.py --html="Schematic_$machine.html"
else
option="${2}"
case ${option} in
"Exporter-QA") dir_path="$1""Exporter-QA"
cd $dir_path
pytest test_exporter_jitx.py --html="Exporter_$machine.html"
;;
"Importer-QA") dir_path="$1""Importer-QA"
cd $dir_path
pytest test_importer_jitx.py --html="Importer_$machine.html"
;;
"JITX-QA") dir_path="$1""JITX-QA"
cd $dir_path
pytest test_jitxqa_jitx.py --html="JITX_$machine.html"
;;
"OCDB-QA") dir_path="$1""OCDB-QA"
cd $dir_path
pytest test_ocdb_jitx.py --html="OCDB_$machine.html"
;;
"Roundtrip-QA") dir_path="$1""Roundtrip-QA"
cd $dir_path
pytest test_roundtrip_jitx.py --html="Roundtrip_$machine.html"
;;
"Schematic-QA") dir_path="$1""Schematic-QA"
cd $dir_path
pytest test_schematic_jitx.py --html="Schematic_$machine.html"
;;
*)
echo "Invalid directory name"
usage
esac
fi