-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
run-tests.sh
executable file
·39 lines (32 loc) · 1.01 KB
/
run-tests.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/sh
# Install the lint-tool, and the shadow-tool
go get -u golang.org/x/lint/golint
go get -u golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
# At this point failures cause aborts
set -e
# Run the linter
echo "Launching linter .."
#
# We have a bunch of errors which we need to mask
#
# opcode/opcode.go:8:2: don't use ALL_CAPS in Go names; use CamelCase
# opcode/opcode.go:11:2: don't use ALL_CAPS in Go names; use CamelCase
# opcode/opcode.go:14:2: don't use ALL_CAPS in Go names; use CamelCase
# opcode/opcode.go:17:2: don't use ALL_CAPS in Go names; use CamelCase
# opcode/opcode.go:20:2: don't use ALL_CAPS in Go names; use CamelCase
#
( golint ./... | grep -v ALL_CAPS > lint.out ) || true
if [ -s lint.out ]; then
echo "Linter errors: "
cat lint.out
exit 0
else
rm lint.out
fi
echo "Completed linter .."
# Run the shadow-checker
echo "Launching shadowed-variable check .."
go vet -vettool=$(which shadow) ./...
echo "Completed shadowed-variable check .."
# Run golang tests
go test ./...