#!/bin/bash

# This script is a proxy that injects the required test flags and strips out test output
# It allows us to use a coverage-enabled binary for e2e tests

BUILD_DIR=${GOPATH}/src/github.com/docker/app/_build

$BUILD_DIR/docker-app.cov \
    -test.coverprofile=$BUILD_DIR/cov/$(uuidgen).out \
    "$@" \
| grep -vE '^PASS$' \
| grep -vE '^coverage:.*$' \
| grep -v '^=== RUN   TestRunMain$'

exit ${PIPESTATUS[0]}
