1
1
#! /bin/bash
2
- #
3
- # This script only tests some of the profilers at the moment. More coverage
4
- # would be nice.
5
2
6
3
set -eE -x;
7
4
@@ -19,6 +16,12 @@ cargo build -p collector --bin rustc-fake
19
16
# Test the profilers
20
17
# ----------------------------------------------------------------------------
21
18
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
+
22
25
# time-passes.
23
26
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
24
27
cargo run -p collector --bin collector -- \
@@ -145,6 +148,41 @@ grep -q "Lines.*Copies.*Function name" results/ll-Test-helloworld-Debug-Full
145
148
test -f results/ll-Test-regex-1.5.5-Debug-Full
146
149
grep -q " Lines.*Copies.*Function name" results/ll-Test-regex-1.5.5-Debug-Full
147
150
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
148
186
149
187
# ----------------------------------------------------------------------------
150
188
# Test option handling
0 commit comments