snforge test

Run tests for a project in the current directory.

[TEST_FILTER]

Passing a test filter will only run tests with an absolute module tree path containing this filter.

-e, --exact

Will only run a test with a name exactly matching the test filter. Test filter must be a whole qualified test name e.g. package_name::my_test instead of just my_test.

-x, --exit-first

Stop executing tests after the first failed test.

-p, --package <SPEC>

Packages to run this command on, can be a concrete package name (foobar) or a prefix glob (foo*).

-w, --workspace

Run tests for all packages in the workspace.

-r, --fuzzer-runs <FUZZER_RUNS>

Number of fuzzer runs.

-s, --fuzzer-seed <FUZZER_SEED>

Seed for the fuzzer.

--ignored

Run only tests marked with #[ignore] attribute.

--include-ignored

Run all tests regardless of #[ignore] attribute.

--rerun-failed

Run tests that failed during the last run

--color <WHEN>

Control when colored output is used. Valid values:

  • auto (default): automatically detect if color support is available on the terminal.
  • always: always display colors.
  • never: never display colors.

--detailed-resources

Display additional info about used resources for passed tests.

--save-trace-data

Saves execution traces of test cases which pass and are not fuzz tests. You can use traces for profiling purposes.

--build-profile

Saves trace data and then builds profiles of test cases which pass and are not fuzz tests. You need cairo-profiler installed on your system. You can set a custom path to cairo-profiler with CAIRO_PROFILER env variable. Profile can be read with pprof, more information: cairo-profiler, pprof

--coverage

Saves trace data and then generates coverage report of test cases which pass and are not fuzz tests. You need cairo-coverage installed on your system. You can set a custom path to cairo-coverage with CAIRO_COVERAGE env variable.

--max-n-steps <MAX_N_STEPS>

Number of maximum steps during a single test. For fuzz tests this value is applied to each subtest separately.

-F, --features <FEATURES>

Comma separated list of features to activate.

--all-features

Activate all available features.

--no-default-features

Do not activate the default feature.

--no-optimization

Build contract artifacts in a separate starknet contract target. Enabling this flag will slow down the compilation process, but the built contracts will more closely resemble the ones used on real networks. This is set to true when using Scarb version less than 2.8.3.

-h, --help

Print help.