-
Notifications
You must be signed in to change notification settings - Fork 30
/
tools.sh
executable file
·56 lines (44 loc) · 1.11 KB
/
tools.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
#!/bin/bash
echo "VaseDB Tools Shell Script."
echo ""
echo "1: testing cmd package."
echo "2: testing conf package."
echo "3: testing server package."
echo "4: testing utils package."
echo "5: testing codecov coverage."
echo ""
case_num=$1
if [ -z "$case_num" ]; then
echo "Please provide an option (1, 2, or 3)."
exit 1
fi
rm -rf ./_temp
mkdir -p ./_temp
function test_cmd_package() {
sudo cd cmd && go test -v
}
function test_all_packages() {
sudo go test -vet=all -race -coverprofile=coverage.out -covermode=atomic -v ./...
}
function test_utils_packages() {
sudo cd utils && go test -v
}
function test_conf_packages(){
cd conf && go test -v
}
if [ "$case_num" -eq 1 ]; then
test_cmd_package
elif [ "$case_num" -eq 2 ]; then
test_conf_packages
elif [ "$case_num" -eq 3 ]; then
echo "Testing server package"
elif [ "$case_num" -eq 4 ]; then
test_utils_packages
elif [ "$case_num" -eq 5 ]; then
test_all_packages
elif [ "$case_num" -eq 8 ]; then
test_cmd_package
sudo go build -o vasedb
else
echo "Invalid option. Please provide a valid option (1, 2, 3, 4, 5, 8)."
fi