Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified binary directory and test executable discovery for coverage #55

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/Makefile.stable.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
'''
]

Expand Down