forked from goby-lang/goby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·40 lines (34 loc) · 1.23 KB
/
travis.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
#!/usr/bin/env bash
SLEEP=0.5
set -e
echo "" > coverage.txt
for d in $(go list ./...); do
if [ $d == "github.com/goby-lang/goby/vm" ]; then
# Test vm's code without running race detection because that breaks plugin tests.
# This can generate full coverage report of vm package.
# Test that need to run without race detection include NoRaceDetection in the name,
# otherwise, they will run twice (in the run below).
NO_RACE_DETECTION=true go test -coverprofile=profile.out -covermode=atomic $d -run NoRaceDetection
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
# Then we test other tests with race detection
go test -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
continue
fi
go test -race -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
# Test if libs that require built in Goby script would work.
# TODO: Write a test for this specific case
make install
goby test specs
./benchmark.rb