Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,9 @@ impl Runner {
.output()
.with_context(|| format!("failed to spawn {cmd:?}"))?;
if output.status.success() {
if std::env::var("WIT_BINDGEN_TRACE").is_ok() {
eprintln!("$ {cmd:?}");
}
return Ok(String::from_utf8_lossy(&output.stdout).into());
}

Expand Down
8 changes: 8 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ cargo run test \
tests/runtime
```

To see every external command (compilers, linkers, ...) that the test harness
runs successfully, set the `WIT_BINDGEN_TRACE` environment variable. Each
command is printed to stderr, which is useful to reproduce a step by hand:

```sh
WIT_BINDGEN_TRACE=1 cargo run test --languages rust tests/runtime/strings
```

## Testing Layout

If you're adding a test, all you should generally have to do is edit files in
Expand Down
Loading