Skip to content

Commit

Permalink
test(pgo): only run on nightly
Browse files Browse the repository at this point in the history
So it won't run on rust-lang/rust's CI
because `CARGO_TEST_DISABLE_NIGHTLY` is set on that.

See rust-lang/rust 133675
  • Loading branch information
weihanglo committed Dec 3, 2024
1 parent 99c4fd1 commit 7a021c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/testsuite/pgo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ fn llvm_profdata() -> Option<PathBuf> {
})
}

#[cargo_test]
// Rustc build may be without profiling support.
// Mark it as nightly so it won't run on rust-lang/rust CI.
#[cfg_attr(target_os = "linux", cargo_test(nightly, reason = "rust-lang/rust#133675"))]
// macOS may emit different LLVM PGO warnings.
// Windows LLVM has different requirements.
#[cfg_attr(not(target_os = "linux"), ignore = "linux only")]
#[cfg_attr(not(target_os = "linux"), cargo_test, ignore = "linux only")]
fn pgo_works() {
let Some(llvm_profdata) = llvm_profdata() else {
return;
Expand Down

0 comments on commit 7a021c3

Please sign in to comment.