Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit eba181f

Browse files
committed
Upgrade to Go 1.7
- Upgrades to Go 1.7 - Introduces test-full to test with the race detector and (new) with the address sanitizer if it is supported by the environment - Cleanup of some scripts Fixes go-clang/gen#113 and go-clang/gen#124
1 parent d2ada07 commit eba181f

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- 1.5
3+
- 1.7.1
44

55
addons:
66
apt:
@@ -13,14 +13,20 @@ addons:
1313
- libclang1-3.8
1414
- libclang-3.8-dev
1515

16+
env:
17+
global:
18+
- CC=clang CXX=clang++
19+
1620
install:
1721
- mkdir -p /home/travis/bin
22+
- sudo ln -s /usr/bin/clang-3.8 /home/travis/bin/clang
1823
- sudo ln -s /usr/bin/llvm-config-3.8 /home/travis/bin/llvm-config
1924
- sudo ldconfig
2025

2126
- llvm-config --version
2227
- llvm-config --includedir
2328
- llvm-config --libdir
29+
- clang --version
2430

2531
- make install-dependencies
2632
- make install-tools
@@ -30,5 +36,4 @@ script:
3036
- make install
3137

3238
# Test without any coverage
33-
- make test-verbose
34-
39+
- make test-full

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
.PHONY: all install install-dependencies install-tools test test-verbose
1+
.PHONY: all install install-dependencies install-tools test test-full test-verbose
22

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++
57

68
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
79
$(eval $(ARGS):;@:) # turn arguments into do-nothing targets
@@ -14,7 +16,10 @@ install:
1416
install-dependencies:
1517
go get -u github.com/stretchr/testify/...
1618
install-tools:
19+
1720
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
1924
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 ./...

scripts/test-full.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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

0 commit comments

Comments
 (0)