From 61e2c9dd38ac58c2351e8b9f7025b74172f9e9da Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Wed, 9 Jan 2019 21:51:20 -0800 Subject: [PATCH] ci: flag integration tests and unit tests --- .travis.yml | 3 ++- script/coverage | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3689dd4..572a31c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,5 @@ script: - ./script/coverage - ./script/lint after_success: -- bash <(curl -s https://codecov.io/bash) -f all.coverprofile +- bash <(curl -s https://codecov.io/bash) -F unittests -f unittests.coverprofile +- bash <(curl -s https://codecov.io/bash) -F integration -f integration.coverprofile diff --git a/script/coverage b/script/coverage index 0ae9b8b..1dace94 100755 --- a/script/coverage +++ b/script/coverage @@ -6,16 +6,19 @@ ext=".coverprofile" find . -name '*'${ext} | xargs rm -f # Unit test coverage. -go test -covermode=count -coverprofile=unit${ext} ./... +go test -covermode=count -coverprofile=unittests${ext} ./... # Integration test coverage. -find . -name 'asm.go' | while read main; do +coverprofiles=() +for main in $(find . -name 'asm.go'); do dir=$(dirname ${main}) name=$(basename ${dir}) coverprofile="${dir}/${name}${ext}" ./script/covermain ${main} ${coverprofile} > /dev/null + coverprofiles+=(${coverprofile}) done +covertool merge --output integration${ext} ${coverprofiles[@]} + # Merge. -all="all${ext}" -find . -name '*'${ext} | xargs covertool merge --output ${all} +covertool merge --output all${ext} unit${ext} integration${ext}