test(pgo): only run on nightly

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
This commit is contained in:
Weihang Lo 2024-12-02 21:18:14 -05:00
parent 99c4fd13ab
commit 4ee2a0a4ff
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7

View File

@ -22,10 +22,15 @@ 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;