Skip to content

Commit fd9fa29

Browse files
authored
Merge pull request #1226 from nnethercote/add-missing-profiler-tests
Add missing profiler tests.
2 parents 62e788e + 9b469ad commit fd9fa29

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

ci/check-profiling.sh

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#!/bin/bash
2-
#
3-
# This script only tests some of the profilers at the moment. More coverage
4-
# would be nice.
52

63
set -eE -x;
74

@@ -19,6 +16,12 @@ cargo build -p collector --bin rustc-fake
1916
# Test the profilers
2017
#----------------------------------------------------------------------------
2118

19+
# These are basic smoke tests that run the profiler and check that the output
20+
# looks plausible, mostly done by grepping for a single line of output that has
21+
# a specific form.
22+
23+
# TODO: self-profile.
24+
2225
# time-passes.
2326
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
2427
cargo run -p collector --bin collector -- \
@@ -145,6 +148,41 @@ grep -q "Lines.*Copies.*Function name" results/ll-Test-helloworld-Debug-Full
145148
test -f results/ll-Test-regex-1.5.5-Debug-Full
146149
grep -q "Lines.*Copies.*Function name" results/ll-Test-regex-1.5.5-Debug-Full
147150

151+
# llvm-ir. `Debug` not `Check` because it works better that way.
152+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
153+
cargo run -p collector --bin collector -- \
154+
profile_local llvm-ir $bindir/rustc \
155+
--id Test \
156+
--profiles Debug \
157+
--cargo $bindir/cargo \
158+
--include helloworld \
159+
--scenarios Full
160+
test -f results/llir-Test-helloworld-Debug-Full
161+
grep -q "; ModuleID" results/llir-Test-helloworld-Debug-Full
162+
163+
# mono-items. `Debug` not `Check` because it works better that way.
164+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
165+
cargo run -p collector --bin collector -- \
166+
profile_local mono-items $bindir/rustc \
167+
--id Test \
168+
--profiles Debug \
169+
--cargo $bindir/cargo \
170+
--include helloworld \
171+
--scenarios Full
172+
test -f results/mono-items-Test-helloworld-Debug-Full/raw
173+
grep -q "MONO_ITEM" results/mono-items-Test-helloworld-Debug-Full/raw
174+
175+
# dep-graph. `IncrFull` not `Full` because it doesn't work with `Full`.
176+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
177+
cargo run -p collector --bin collector -- \
178+
profile_local dep-graph $bindir/rustc \
179+
--id Test \
180+
--profiles Check \
181+
--cargo $bindir/cargo \
182+
--include helloworld \
183+
--scenarios IncrFull
184+
test -f results/dep-graph-Test-helloworld-Check-IncrFull.txt
185+
grep -q "hir_owner" results/dep-graph-Test-helloworld-Check-IncrFull.txt
148186

149187
#----------------------------------------------------------------------------
150188
# Test option handling

0 commit comments

Comments
 (0)