Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
kardolus
GitHub Repository: kardolus/chatgpt-cli
Path: blob/main/scripts/run_test.sh
2649 views
1
#!/usr/bin/env bash
2
set -euo pipefail
3
4
if [ $# -eq 0 ]; then
5
echo "No arguments provided"
6
exit 1
7
fi
8
9
test_type=$1
10
11
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
12
13
echo "Run ${test_type} Tests"
14
set +e
15
go test -parallel 1 -timeout 0 -mod=vendor ./test/... -v -run ${test_type}
16
exit_code=$?
17
18
if [ "$exit_code" != "0" ]; then
19
echo -e "\n\033[0;31m** GO ${test_type} Test Failed **\033[0m"
20
else
21
echo -e "\n\033[0;32m** GO ${test_type} Test Succeeded **\033[0m"
22
fi
23
24
exit $exit_code
25
26
27