-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzinc.sh
executable file
·57 lines (47 loc) · 1.05 KB
/
zinc.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
#!/bin/bash
ZINC="zinc component add -p kit -n"
FLOAT32_2="-d x:float32 -d y:float32"
_rm() {
if [ -f "$1" ]; then
rm $1
fi
}
test() {
echo "Running Go Tests"
go test -race -coverprofile=coverage.txt -covermode=atomic
go tool cover -html=coverage.txt -o ./coverage.html
}
kit_clean() {
cd ./kit
echo "Cleaning Kit Project ..."
find . -name "*.go" -type f
read -n 1 -p "... Files will be deleted. Proceed? [y/n]" choice
echo ""
case "$choice" in
y|Y ) find . -name "*.go" -type f -delete;;
n|N ) echo "Skipping ...";;
* ) ;;
esac
}
kit_gen() {
kit_clean
echo "Generating Kit ..."
${ZINC} LocalPosition2 ${FLOAT32_2}
${ZINC} LocalRotation2 ${FLOAT32_2}
${ZINC} LocalScale2 ${FLOAT32_2}
${ZINC} Velocity2 ${FLOAT32_2}
}
bench() {
cd ./benchmark
echo "Running Benchmarks ..."
go test -bench . -benchmem -benchtime 15s -cpu 1,4 -count 2
}
clean() {
echo "Cleaning Project ..."
_rm ./coverage.html
_rm ./coverage.txt
}
install() {
go install ./cmd/zinc
}
$@