Commit c0ead61
authored
Give a better error message if llvm-profdata isn't installed (#55)
Previously, the test failed to check if the command actually succeeded,
and so would run assertions on the command's output even if it failed.
Before:
```
$ cargo test --test profdata -- profraws
LLVM tools failed:
error: no such command: `profdata`
help: view all installed commands with `cargo --list`
help: find a package to install `profdata` with `cargo search
cargo-profdata`
"c-general.profraw"
LLVM tools failed:
error: no such command: `profdata`
help: view all installed commands with `cargo --list`
help: find a package to install `profdata` with `cargo search
cargo-profdata`
"compressed.profraw"
<... repeated for each failing test ...>
```
After:
```
$ cargo test --test profdata -- profdatas
---- show_profdatas stdout ----
thread 'show_profraws' panicked at
/rustc/ec7c02612527d185c379900b613311bc1dcbf7dc/library/core/src/ops/function.rs:253:5:
Unexpected failure.
code=101
stderr=```"error: No such file or directory (os error 2)\n"```
command=`"cargo" "profdata" "--" "--version"`
help=`run 'rustup component add llvm-tools-preview'`
code=101
stdout=""
stderr="error: No such file or directory (os error 2)\n"
note: run with `RUST_BACKTRACE=1` environment variable to display a
backtrace
```1 parent 2315584 commit c0ead61
1 file changed
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
129 | 149 | | |
| 150 | + | |
| 151 | + | |
130 | 152 | | |
131 | 153 | | |
132 | 154 | | |
| |||
145 | 167 | | |
146 | 168 | | |
147 | 169 | | |
148 | | - | |
| 170 | + | |
149 | 171 | | |
150 | 172 | | |
151 | 173 | | |
| |||
177 | 199 | | |
178 | 200 | | |
179 | 201 | | |
| 202 | + | |
| 203 | + | |
180 | 204 | | |
181 | 205 | | |
182 | 206 | | |
| |||
197 | 221 | | |
198 | 222 | | |
199 | 223 | | |
200 | | - | |
| 224 | + | |
201 | 225 | | |
202 | 226 | | |
203 | 227 | | |
| |||
224 | 248 | | |
225 | 249 | | |
226 | 250 | | |
227 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
228 | 256 | | |
229 | 257 | | |
230 | 258 | | |
| |||
0 commit comments