Skip to content

Commit

Permalink
test(pgo): determine test runnability at compile time (#14874)
Browse files Browse the repository at this point in the history
### What does this PR try to resolve?

Address
#14859 (comment)

I found that detecting llvm-profdata [requires more
works](weihanglo#73), so do this first.
  • Loading branch information
epage authored Nov 30, 2024
2 parents 9ac36a6 + c360958 commit 0d730ac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/testsuite/pgo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ fn llvm_profdata() -> Option<PathBuf> {
}

#[cargo_test]
// macOS may emit different LLVM PGO warnings.
// Windows LLVM has different requirements.
#[cfg_attr(not(target_os = "linux"), ignore = "linux only")]
fn pgo_works() {
if cfg!(not(target_os = "linux")) {
// macOS may emit different LLVM PGO warnings.
// Windows LLVM has different requirements.
return;
}

let Some(llvm_profdata) = llvm_profdata() else {
return;
};
Expand Down

0 comments on commit 0d730ac

Please sign in to comment.