| Crates.io | solfmt |
| lib.rs | solfmt |
| version | 0.3.1 |
| created_at | 2022-12-13 04:46:43.868085+00 |
| updated_at | 2024-03-15 23:06:18.142023+00 |
| description | Formats output of Solana's `cargo test-bpf/test-sbf` command |
| homepage | |
| repository | https://github.com/thlorenz/solfmt |
| max_upload_size | |
| id | 735530 |
| size | 1,116,710 |
Formats output of Solana's cargo test-bpf/test-sbf command.

cargo install solfmt
cargo test-sbf -- --test-threads=1)stderr into stdout (2>&1)solfmt (| sofmt)cargo test-sbf -- --test-threads=1 2>&1 | solfmt
Since we're piping the output of cargo test-sbf into solfmt it doesn't print in colors by
default.
We can fix that by setting the CARGO_TERM_COLOR env var appropriately.
CARGO_TERM_COLOR=always cargo test-sbf -- --nocapture --test-threads=1 2>&1 | solfmt
Since this is a lot to type you should add a reusable function to your bashrc.
The below defined in my dotfiles allows to focus on a simple test as well by providing it as an argument.
function cg-tsbf() {
clear;
CARGO_TERM_COLOR=always cargo test-sbf $1 -- --nocapture --test-threads=1 2>&1 | solfmt
}
MIT