Crate proc_debug

source
Expand description

§proc-debug crate Latest Version Documentation GitHub Actions

Screenshot

§Belief configuration

  • Cargo.toml
#[dependencies]
proc-debug = "0.1"
  • lib.rs
#[proc_macro]
#[proc_debug::proc_debug]
fn my_macro(attr: TokenStream, input: TokenStream) -> TokenStream { .. }
  • show help (–nocapture is important)
$ PROC_DEBUG_FLAGS="--help" cargo build --test <test-name> -- --nocapture
Usage: proc-debug [-a] [-n <not...>] [-p <path...>] [-d <depth>] [-c <count>]
                  [-v] [queries...]

Input for `proc-debug`

Options:
  -a, --all            debug all macros
  -n, --not <not>      hide outputs match
  -p, --path <path>    full or partial path of macro definition
  -d, --depth <depth>  depth to show in macro output
  -c, --count <count>  count to show in display
  -v, --verbose        verbose
  -h, --help           Show this help message and exit.
  • show all dumps (called from <test-name>)
$ PROC_DEBUG_FLAGS="-a" cargo build --test <test-name> -- --nocapture
  • filtered
$ PROC_DEBUG_FLAGS="your_macro_path" cargo build --test <test-name> -- --nocapture

Attribute Macros§