From 6b2d57f4ae8051b8f2f578a972ea9ccc3d76d116 Mon Sep 17 00:00:00 2001 From: PoiScript Date: Fri, 17 Nov 2023 16:47:15 +0800 Subject: [PATCH] docs: add development.md --- development.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 development.md diff --git a/development.md b/development.md new file mode 100644 index 0000000..df8e8c7 --- /dev/null +++ b/development.md @@ -0,0 +1,41 @@ +## Format, test, lint + +```shell +cargo fmt -- --check +cargo test --all-features +cargo clippy --allow-dirty --allow-staged +``` + +## Update snapshot testing + +```shell +cargo install cargo-insta +cargo insta test --all-features +cargo insta review +``` + +## Fuzz testing + +```shell +cargo install cargo-fuzz +rustup default nightly +cargo fuzz run fuzz_target_1 +``` + +## Benchmark + +```shell +curl -q https://orgmode.org/worg/doc.org --output ./benches/doc.org +curl -q https://orgmode.org/worg/org-faq.org --output ./benches/org-faq.org +curl -q https://orgmode.org/worg/org-syntax.org --output ./benches/org-syntax.org + +cargo bench --bench parse +``` + +## Benchmark w/ flamegraph + +```shell +cargo install flamegraph +cargo flamegraph --bench parse -o baseline.svg -- --bench +# then open baseline.svg with your browser +```