From 8963a561090fa18f8efbedd1731b49b977d9bd81 Mon Sep 17 00:00:00 2001 From: Gregory Edison Date: Tue, 21 May 2024 15:19:01 +0200 Subject: [PATCH] add docs and publish bin --- .github/workflows/release.yml | 1 + README.md | 25 +++++++++++++++++++++++++ src/bin/scarb-native-test.rs | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8683ada10..094a24cee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,7 @@ jobs: with: files: | target/release/cairo-native-test + target/release/scarb-native-test target/release/cairo-native-compile target/release/cairo-native-dump target/release/cairo-native-run diff --git a/README.md b/README.md index 25e0ccfa8..f041373c6 100644 --- a/README.md +++ b/README.md @@ -802,6 +802,31 @@ cairo-native-test ./cairo-tests/ This will run all the tests (functions marked with the `#[test]` attribute). +# scarb-native-test cli tool + +This tool mimics the `scarb test` [command](https://github.com/software-mansion/scarb/tree/main/extensions/scarb-cairo-test). +You can download it on our [releases](https://github.com/lambdaclass/cairo_native/releases) page. + +```bash +$ scarb-native-test --help +Compiles all packages from a Scarb project matching `packages_filter` and +runs all functions marked with `#[test]`. Exits with 1 if the compilation +or run fails, otherwise 0. + +Usage: scarb-native-test [OPTIONS] + +Options: + -p, --package Packages to run this command on, can be a concrete package name (`foobar`) or a prefix glob (`foo*`) [env: SCARB_PACKAGES_FILTER=] [default: *] + -w, --workspace Run for all packages in the workspace + -f, --filter Run only tests whose name contain FILTER [default: ] + --include-ignored Run ignored and not ignored tests + --ignored Run only ignored tests + --run-mode Run with JIT or AOT (compiled) [default: jit] [possible values: aot, jit] + -O, --opt-level Optimization level, Valid: 0, 1, 2, 3. Values higher than 3 are considered as 3 [default: 0] + -h, --help Print help + -V, --version Print version +``` + ## Debugging Tips ### Useful environment variables diff --git a/src/bin/scarb-native-test.rs b/src/bin/scarb-native-test.rs index abe1a6c39..bbdeb299b 100644 --- a/src/bin/scarb-native-test.rs +++ b/src/bin/scarb-native-test.rs @@ -14,7 +14,7 @@ use utils::{RunArgs, RunMode}; /// runs all functions marked with `#[test]`. Exits with 1 if the compilation /// or run fails, otherwise 0. #[derive(Parser, Clone, Debug)] -#[command(author, version)] +#[command(author, version, verbatim_doc_comment)] struct Args { #[command(flatten)] packages_filter: PackagesFilter,