Skip to content

Commit b80cbaf

Browse files
committed
Upgrade to Go 1.7
- Upgrades to Go 1.7 - Introduces test-throughout 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 f2f3481 commit b80cbaf

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

.travis.yml

Lines changed: 6 additions & 2 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,6 +13,10 @@ addons:
1313
- libclang1-3.4
1414
- libclang-3.4-dev
1515

16+
env:
17+
- CC=clang
18+
- CXX=clang++
19+
1620
install:
1721
- mkdir -p /home/travis/bin
1822
- sudo ln -s /usr/bin/llvm-config-3.4 /home/travis/bin/llvm-config
@@ -31,5 +35,5 @@ script:
3135
- make install
3236

3337
# Test without any coverage
34-
- make test-verbose
38+
- make test-throughout
3539

Makefile

Lines changed: 8 additions & 3 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-throughout 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:
1821
CGO_LDFLAGS="-L`llvm-config --libdir`" go test -timeout 60s -race ./...
22+
test-throughout:
23+
$(ROOT_DIR)/scripts/test-throughout.sh
1924
test-verbose:
2025
CGO_LDFLAGS="-L`llvm-config --libdir`" go test -timeout 60s -race -v ./...

scripts/test-throughout.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 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 ./...

0 commit comments

Comments
 (0)