summaryrefslogtreecommitdiff
path: root/scripts/src/bin/generate-charts/main.rs
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-03-12 18:48:45 +0100
committerGitHub <noreply@github.com>2024-03-12 18:48:45 +0100
commit398b2af4ea37be98093bdf7ac185a468c62c4aef (patch)
treef21db1a58bcd4ddbe6661db59f71fe5a8b483bc3 /scripts/src/bin/generate-charts/main.rs
parentacb91b800d3668e9fb6dbb5838e2593764a0457e (diff)
test: make tests work on more targets (#11)
- Tests can now be run on more targets (Fixes #7) - Nightly version has been updated to fix broken builds in some cases (Fixes #8)
Diffstat (limited to 'scripts/src/bin/generate-charts/main.rs')
-rw-r--r--scripts/src/bin/generate-charts/main.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/src/bin/generate-charts/main.rs b/scripts/src/bin/generate-charts/main.rs
new file mode 100644
index 0000000..1206e5f
--- /dev/null
+++ b/scripts/src/bin/generate-charts/main.rs
@@ -0,0 +1,35 @@
+mod progress;
+use std::{path::PathBuf, str::FromStr};
+
+use eyre::Result;
+
+fn main() -> Result<()> {
+ generate_charts()
+}
+
+fn generate_charts() -> Result<()> {
+ let results_dir = PathBuf::from_str("./crates/tinywasm/tests/generated")?;
+
+ // check if the folder exists
+ if !results_dir.exists() {
+ return Err(eyre::eyre!(
+ "This script should be run from the root of the project, and the test results should be generated first."
+ ));
+ }
+
+ progress::create_progress_chart(
+ "WebAssembly 1.0 Test Suite",
+ &results_dir.join("mvp.csv"),
+ &results_dir.join("progress-mvp.svg"),
+ )?;
+ println!("created progress chart: {}", results_dir.join("progress-mvp.svg").display());
+
+ progress::create_progress_chart(
+ "WebAssembly 2.0 Test Suite",
+ &results_dir.join("2.0.csv"),
+ &results_dir.join("progress-2.0.svg"),
+ )?;
+ println!("created progress chart: {}", results_dir.join("progress-2.0.svg").display());
+
+ Ok(())
+}