diff --git a/.travis.yml b/.travis.yml index a07972949..0fb6e8090 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,12 +36,13 @@ before_install: script: - . ./.travis.gofmt.sh + # Run the unit tests first - | set -e echo "" > coverage.txt - go test -race -coverprofile=profile.out -coverpkg ./... + go test -tags=integration -race -coverprofile=profile.out -coverpkg ./... if [ -f profile.out ]; then cat profile.out >> coverage.txt rm profile.out diff --git a/README.md b/README.md index ab90d29bd..04a3025b7 100644 --- a/README.md +++ b/README.md @@ -129,11 +129,17 @@ tree is a semi-intelligent way and producing Go. Easy, right!? # Testing -Testing is done with a set of integrations tests in the form of complete C -programs that can be found in the +By default only unit tests are run with `go test`. You can also include the +integration tests: + +```bash +go test -tags=integration ./... +``` + +Integration tests in the form of complete C programs that can be found in the [tests](https://github.com/elliotchance/c2go/tree/master/tests) directory. -For each of those files: +Integration tests work like this: 1. Clang compiles the C to a binary as normal. 2. c2go converts the C file to Go. @@ -141,8 +147,6 @@ For each of those files: 4. Both binaries are executed and the output is compared. All C files will contain some output so the results can be verified. -The test suite is run with `go test`. - # Contributing Contributing is done with pull requests. There is no help that is too small! :) diff --git a/main_test.go b/main_test.go index 35f8e83aa..74e8c66fc 100644 --- a/main_test.go +++ b/main_test.go @@ -1,3 +1,5 @@ +// +build integration + package main import (