mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 14:07:04 +00:00
rewrite profile to rmake
This commit is contained in:
parent
a1555eb0d6
commit
b15e72a9ed
@ -113,7 +113,6 @@ run-make/pgo-indirect-call-promotion/Makefile
|
||||
run-make/pointer-auth-link-with-c/Makefile
|
||||
run-make/print-calling-conventions/Makefile
|
||||
run-make/print-target-list/Makefile
|
||||
run-make/profile/Makefile
|
||||
run-make/prune-link-args/Makefile
|
||||
run-make/raw-dylib-alt-calling-convention/Makefile
|
||||
run-make/raw-dylib-c/Makefile
|
||||
|
@ -1,13 +0,0 @@
|
||||
# needs-profiler-support
|
||||
# ignore-cross-compile
|
||||
|
||||
include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -g -Z profile test.rs
|
||||
$(call RUN,test) || exit 1
|
||||
[ -e "$(TMPDIR)/test.gcno" ] || (echo "No .gcno file"; exit 1)
|
||||
[ -e "$(TMPDIR)/test.gcda" ] || (echo "No .gcda file"; exit 1)
|
||||
$(RUSTC) -g -Z profile -Z profile-emit=$(TMPDIR)/abc/abc.gcda test.rs
|
||||
$(call RUN,test) || exit 1
|
||||
[ -e "$(TMPDIR)/abc/abc.gcda" ] || (echo "gcda file not emitted to defined path"; exit 1)
|
22
tests/run-make/profile/rmake.rs
Normal file
22
tests/run-make/profile/rmake.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// This test revolves around the rustc flag -Z profile, which should
|
||||
// generate a .gcno file (initial profiling information) as well
|
||||
// as a .gcda file (branch counters). The path where these are emitted
|
||||
// should also be configurable with -Z profile-emit. This test checks
|
||||
// that the files are produced, and then that the latter flag is respected.
|
||||
// See https://github.com/rust-lang/rust/pull/42433
|
||||
|
||||
//@ ignore-cross-compile
|
||||
//@ needs-profiler-support
|
||||
|
||||
use run_make_support::{run, rustc};
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
rustc().arg("-g").arg("-Zprofile").input("test.rs").run();
|
||||
run("test");
|
||||
assert!(Path::new("test.gcno").exists(), "no .gcno file");
|
||||
assert!(Path::new("test.gcda").exists(), "no .gcda file");
|
||||
rustc().arg("-g").arg("-Zprofile").arg("-Zprofile-emit=abc/abc.gcda").input("test.rs").run();
|
||||
run("test");
|
||||
assert!(Path::new("abc/abc.gcda").exists(), "gcda file not emitted to defined path");
|
||||
}
|
Loading…
Reference in New Issue
Block a user