From fc97f2cab27658b81ef9409b3f388226a4745cee Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Sun, 17 Dec 2023 15:57:50 +0100 Subject: chore: improve progress graph, add contributing.md Signed-off-by: Henry Gressmann --- .cargo/config.toml | 4 +- CONTRIBUTING.md | 26 +++++++++++++ crates/tinywasm/tests/charts/progress.rs | 14 ++++--- crates/tinywasm/tests/progress-mvp.svg | 64 ++++++++++++++++---------------- 4 files changed, 70 insertions(+), 38 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.cargo/config.toml b/.cargo/config.toml index 4148675..f9691ee 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,6 @@ [alias] version-dev="workspaces version --no-git-commit --force tinywasm*" dev="run -- -l debug run" -spec-mvp="test --package tinywasm --test mvp -- test_mvp --exact --nocapture --ignored" + +test-mvp="test --package tinywasm --test mvp -- test_mvp --exact --nocapture --ignored" +generate-charts="test --package tinywasm --test mvp -- generate_charts --ignored" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2fa8ac8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Common Commands + +> To improve the development experience, a number of aliases have been added to the `.cargo/config.toml` file. These can be run using `cargo `. + +- **`cargo dev`**\ + e.g. `cargo dev -f check ./examples/wasm/call.wat -a i32:0`\ + Run the development version of the tinywasm-cli. This is the main command used for developing new features. + +- **`cargo generate-charts`**\ + Generate test result charts + +- **`cargo test-mvp`**\ + Run the WebAssembly MVP (1.0) test suite + +- **`cargo version-dev`**\ + Bump the version to the next dev version. This should be used after a release so test results are not overwritten. Does not create a new github release. + +## Workspace Commands + +> These commands require the [cargo-workspaces](https://crates.io/crates/cargo-workspaces) crate to be installed. + +- **`cargo workspaces version`**\ + Bump the version of all crates in the workspace and push changes to git. This is used for releasing new versions on github. + +- **`cargo workspaces publish --from-git`**\ + Publish all crates in the workspace to crates.io. This should be used a new version has been released on github. After publishing, the version should be bumped to the next dev version. diff --git a/crates/tinywasm/tests/charts/progress.rs b/crates/tinywasm/tests/charts/progress.rs index c5d6c6f..a8e3912 100644 --- a/crates/tinywasm/tests/charts/progress.rs +++ b/crates/tinywasm/tests/charts/progress.rs @@ -40,9 +40,10 @@ pub fn create_progress_chart(csv_path: &Path, output_path: &Path) -> Result<()> root_area.fill(&WHITE)?; let mut chart = ChartBuilder::on(&root_area) - .x_label_area_size(35) - .y_label_area_size(60) + .x_label_area_size(45) + .y_label_area_size(70) .margin(10) + .margin_top(20) .caption("MVP TESTSUITE", (FONT, 30.0, FontStyle::Bold)) .build_cartesian_2d((0..(versions.len() - 1) as u32).into_segmented(), 0..max_tests)?; @@ -52,16 +53,19 @@ pub fn create_progress_chart(csv_path: &Path, output_path: &Path) -> Result<()> .bold_line_style(&BLACK.mix(0.3)) .max_light_lines(10) .disable_x_mesh() - .x_labels((versions.len()).min(4)) .y_desc("Tests Passed") + .y_label_style((FONT, 15)) .x_desc("TinyWasm Version") + .x_labels((versions.len()).min(4)) + .x_label_style((FONT, 15)) .x_label_formatter(&|x| { let SegmentValue::CenterOf(value) = x else { return "".to_string(); }; - versions.get(*value as usize).unwrap_or(&"".to_string()).to_string() + let v = versions.get(*value as usize).unwrap_or(&"".to_string()).to_string(); + format!("{} ({})", v, data[*value as usize]) }) - .axis_desc_style((FONT, 15)) + .axis_desc_style((FONT, 15, FontStyle::Bold)) .draw()?; chart.draw_series( diff --git a/crates/tinywasm/tests/progress-mvp.svg b/crates/tinywasm/tests/progress-mvp.svg index f5a23e6..4e3410f 100644 --- a/crates/tinywasm/tests/progress-mvp.svg +++ b/crates/tinywasm/tests/progress-mvp.svg @@ -1,54 +1,54 @@ - + MVP TESTSUITE - + Tests Passed - + TinyWasm Version - - - - - - - + + + + + + + 0 - - + + 5000 - - + + 10000 - - + + 15000 - - + + 20000 - - - -v0.0.3 + + + +v0.0.3 (9258) - - -v0.0.4 + + +v0.0.4 (9258) - - -v0.0.5-alpha.0 + + +v0.0.5-alpha.0 (9262) - - - - + + + + -- cgit v1.3.1