From 2a922c2e8afc1e3b3f259baac6a22b0d45374f1a Mon Sep 17 00:00:00 2001 From: Azriel Hoh Date: Sat, 30 Dec 2017 16:07:33 +1300 Subject: [PATCH] Use cargo test to execute binaries during coverage collection This prevents the need to discover binaries relevant to the current coverage collection operation, which has proven to be difficult / error prone. Issue #50 --- src/Makefile.stable.toml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Makefile.stable.toml b/src/Makefile.stable.toml index b139f444..0a45c0d5 100755 --- a/src/Makefile.stable.toml +++ b/src/Makefile.stable.toml @@ -525,11 +525,6 @@ else mkdir -p ./target/coverage fi -BINARY_DIRECTORY=target/debug -if [ -n "$CARGO_MAKE_WORKSPACE_TARGET_DIRECTORY" ]; then - BINARY_DIRECTORY="${CARGO_MAKE_WORKSPACE_TARGET_DIRECTORY}/debug" -fi - KCOV_EXCLUDE_LINE_ARG="" if [ -n "$CARGO_MAKE_KCOV_EXCLUDE_LINE" ]; then KCOV_EXCLUDE_LINE_ARG="--exclude-line=${CARGO_MAKE_KCOV_EXCLUDE_LINE}" @@ -540,14 +535,7 @@ if [ -n "$CARGO_MAKE_KCOV_EXCLUDE_REGION" ]; then KCOV_EXCLUDE_REGION_ARG="--exclude-region=${CARGO_MAKE_KCOV_EXCLUDE_REGION}" fi -echo "Running tests from directory: ${BINARY_DIRECTORY}" -for file in $(find "${BINARY_DIRECTORY}" -type f -maxdepth 1 | grep -v "\.d$\|\.rlib$\|\.so$" | grep -e "-[a-z0-9]*") -do - if "$file" ; then - echo "Running file: $file" - kcov --include-pattern=${CARGO_MAKE_WORKING_DIRECTORY}/src/ "$KCOV_EXCLUDE_LINE_ARG" "$KCOV_EXCLUDE_REGION_ARG" "$TARGET_DIRECTORY" "$file" || true - fi -done +kcov --include-pattern=${CARGO_MAKE_WORKING_DIRECTORY}/src/ "$KCOV_EXCLUDE_LINE_ARG" "$KCOV_EXCLUDE_REGION_ARG" "$TARGET_DIRECTORY" cargo test || true ''' ]