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

Add PROFILE_FLAGS to profileable targets #334

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
ifeq ($(origin PROFILE), undefined)
else
PROFILE_FLAGS = -C instrument-coverage
endif

ifeq ($(origin FEDORA_RELEASE), undefined)
else
FEDORA_RELEASE_ARGS = --release=${FEDORA_RELEASE}
Expand All @@ -22,7 +27,7 @@ check-typos:
typos

build:
RUSTFLAGS="${DENY}" cargo build
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" cargo build

test-compare-fedora-versions:
echo "Testing that COMPARE_FEDORA_VERSIONS environment variable is set to a valid path"
Expand Down Expand Up @@ -61,21 +66,21 @@ fmt-ci:
cargo fmt -- --check

release:
RUSTFLAGS="${DENY}" cargo build --release
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" cargo build --release

test:
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 cargo test -- --skip test_mutex_poisoning_panic
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" RUST_BACKTRACE=1 cargo test -- --skip test_mutex_poisoning_panic

test-mutex:
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 cargo test --features=mutex -- --skip test_mutex_poisoning_panic
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" RUST_BACKTRACE=1 cargo test --features=mutex -- --skip test_mutex_poisoning_panic

test-mutex-guard:
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test --features=mutex test_mutex_poisoning_panic
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test --features=mutex test_mutex_poisoning_panic

# Loopback tests must have the mutex feature enabled because Rust runs the tests
# on multiple threads which will cause a panic if the mutex feature is not enabled.
test-loopback:
RUSTFLAGS="${DENY}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER='sudo -E' cargo test --features=mutex -- --ignored --skip test_mutex_poisoning_panic
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER='sudo -E' cargo test --features=mutex -- --ignored --skip test_mutex_poisoning_panic

yamllint:
yamllint --strict .github/workflows/*.yml
Expand Down