From 39548b23b9e0306e823296ba67207d3a54b60e39 Mon Sep 17 00:00:00 2001 From: Adrian Gallagher Date: Tue, 22 Aug 2017 10:26:13 +1000 Subject: [PATCH] Move test files to testdata dir --- .gitignore | 5 ++++- .travis.yml | 2 +- coverage.txt => testdata/coverage.txt | 0 test.sh => testdata/test.sh | 11 +++++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) rename coverage.txt => testdata/coverage.txt (100%) rename test.sh => testdata/test.sh (51%) diff --git a/.gitignore b/.gitignore index bbd9d210..c93b5407 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ config.json config.dat node_modules lib -.vscode \ No newline at end of file +.vscode + +testdata/dump +testdata/writefiletest \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 52f76868..bcb19800 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_install: - go get -t -v ./... script: - - ./test.sh + - ./testdata/test.sh install: - go get github.com/gorilla/websocket diff --git a/coverage.txt b/testdata/coverage.txt similarity index 100% rename from coverage.txt rename to testdata/coverage.txt diff --git a/test.sh b/testdata/test.sh similarity index 51% rename from test.sh rename to testdata/test.sh index fc77c1ce..ec56d6e2 100755 --- a/test.sh +++ b/testdata/test.sh @@ -1,12 +1,19 @@ #!/usr/bin/env bash set -e -echo "" > coverage.txt + +if [ -n "$TRAVIS_BUILD_DIR" ]; then + cd $TRAVIS_BUILD_DIR +else + cd $GOPATH/src/github.com/thrasher-/gocryptotrader +fi + +echo "" > testdata/coverage.txt for d in $(go list ./... | grep -v vendor); do go test -race -coverprofile=profile.out -covermode=atomic -cover $d if [ -f profile.out ]; then - cat profile.out >> coverage.txt + cat profile.out >> testdata/coverage.txt rm profile.out fi done