diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 20c9ec31fc..3329fef4b9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,6 +18,7 @@ env: cairo_programs/**/*.json !cairo_programs/manually_compiled/* examples/wasm-demo/src/array_sum.json + TEST_COLLECT_COVERAGE: 1 PROPTEST_CASES: 100 jobs: diff --git a/Makefile b/Makefile index 3c2889f478..06c7f41050 100644 --- a/Makefile +++ b/Makefile @@ -238,15 +238,20 @@ cairo-vm_proof_trace: $(CAIRO_RS_TRACE_PROOF) $(CAIRO_RS_MEM_PROOF) $(CAIRO_RS_A cairo_trace: $(CAIRO_TRACE) $(CAIRO_MEM) cairo-vm_trace: $(CAIRO_RS_TRACE) $(CAIRO_RS_MEM) +TEST_COMMAND:=cargo nextest run +ifdef TEST_COLLECT_COVERAGE + TEST_COMMAND:=cargo llvm-cov nextest --no-report +endif + test: cairo_proof_programs cairo_test_programs cairo_1_test_contracts cairo_2_test_contracts - cargo llvm-cov nextest --no-report --workspace --features "test_utils, cairo-1-hints" + $(TEST_COMMAND) --workspace --features "test_utils, cairo-1-hints" test-no_std: cairo_proof_programs cairo_test_programs - cargo llvm-cov nextest --no-report --workspace --features test_utils --no-default-features + $(TEST_COMMAND) --workspace --features test_utils --no-default-features test-wasm: cairo_proof_programs cairo_test_programs # NOTE: release mode is needed to avoid "too many locals" error wasm-pack test --release --node vm --no-default-features test-extensive_hints: cairo_proof_programs cairo_test_programs - cargo llvm-cov nextest --no-report --workspace --features "test_utils, cairo-1-hints, extensive_hints" + $(TEST_COMMAND) --workspace --features "test_utils, cairo-1-hints, extensive_hints" check-fmt: cargo fmt --all -- --check