This repository was archived by the owner on Mar 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +30
-8
lines changed Expand file tree Collapse file tree 3 files changed +30
-8
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,14 +13,20 @@ addons:
13
13
- libclang1-3.8
14
14
- libclang-3.8-dev
15
15
16
+ env :
17
+ global :
18
+ - CC=clang CXX=clang++
19
+
16
20
install :
17
21
- mkdir -p /home/travis/bin
22
+ - sudo ln -s /usr/bin/clang-3.8 /home/travis/bin/clang
18
23
- sudo ln -s /usr/bin/llvm-config-3.8 /home/travis/bin/llvm-config
19
24
- sudo ldconfig
20
25
21
26
- llvm-config --version
22
27
- llvm-config --includedir
23
28
- llvm-config --libdir
29
+ - clang --version
24
30
25
31
- make install-dependencies
26
32
- make install-tools
@@ -30,5 +36,4 @@ script:
30
36
- make install
31
37
32
38
# Test without any coverage
33
- - make test-verbose
34
-
39
+ - make test-full
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
- CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -race ./...
21
+ CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s ./...
22
+ test-full :
23
+ $(ROOT_DIR ) /scripts/test-full.sh
19
24
test-verbose :
20
- CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -race - v ./...
25
+ CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -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 race detector
8
+ CGO_LDFLAGS=" -L` llvm-config --libdir` " go test -timeout 60s -v -race ./...
9
+
10
+ # Test with the address sanitizer
11
+ # TODO there is maybe a problem within clang https://github.com/go-clang/gen/issues/123
12
+ # 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
You can’t perform that action at this time.
0 commit comments