File tree 3 files changed +26
-5
lines changed 3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 1
1
language : go
2
2
go :
3
- - 1.5
3
+ - 1.7.1
4
4
5
5
addons :
6
6
apt :
@@ -13,6 +13,10 @@ addons:
13
13
- libclang1-3.4
14
14
- libclang-3.4-dev
15
15
16
+ env :
17
+ global :
18
+ - CC=clang CXX=clang++
19
+
16
20
install :
17
21
- mkdir -p /home/travis/bin
18
22
- sudo ln -s /usr/bin/llvm-config-3.4 /home/travis/bin/llvm-config
@@ -31,5 +35,5 @@ script:
31
35
- make install
32
36
33
37
# Test without any coverage
34
- - make test-verbose
38
+ - make test-full
35
39
Original file line number Diff line number Diff line change 1
- .PHONY : all install install-dependencies install-tools test test-verbose
1
+ .PHONY : all install install-dependencies install-tools test test-full test- verbose
2
2
3
- ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
4
- export ROOT_DIR
3
+ export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
4
+
5
+ export CC := clang
6
+ export CXX := clang++
5
7
6
8
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS ) ) ,$(MAKECMDGOALS ) )
7
9
$(eval $(ARGS ) :;@:) # turn arguments into do-nothing targets
@@ -14,7 +16,10 @@ install:
14
16
install-dependencies :
15
17
go get -u github.com/stretchr/testify/...
16
18
install-tools :
19
+
17
20
test :
18
21
CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -race ./...
22
+ test-full :
23
+ $(ROOT_DIR ) /scripts/test-full.sh
19
24
test-verbose :
20
25
CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -race -v ./...
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -exuo pipefail
4
+
5
+ LLVM_VERSION=$( clang --version | grep --max-count=1 " clang version" | sed -r ' s/^.*clang version ([0-9]+\.[0-9]+).+$/\1/' )
6
+
7
+ # Test with the address sanitizer
8
+ # TODO there is maybe a problem within clang https://github.com/go-clang/gen/issues/123
9
+ # if [ $(echo "$LLVM_VERSION>=3.9" | bc -l) -ne 0 ] && [ $(find `llvm-config --libdir` | grep libclang_rt.san-x86_64.a | wc -l) -ne 0 ]; then CGO_LDFLAGS="-L`llvm-config --libdir` -fsanitize=memory" CGO_CPPFLAGS='-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer' go test -timeout 60s -v -msan ./...; fi
10
+
11
+ # Test with the race detector
12
+ CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -v -race ./...
You can’t perform that action at this time.
0 commit comments