forked from noir-lang/noir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added scripts for measuring the test coverage
- Loading branch information
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /bin/sh | ||
|
||
rm noir_tests.profdata `find . -name "*.profraw"` | ||
cargo clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
export RUSTFLAGS="-C instrument-coverage" | ||
cargo test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /bin/sh | ||
|
||
llvm-profdata merge -sparse `find . -name "*.profraw"` -o noir_tests.profdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /bin/sh | ||
|
||
llvm-cov show -Xdemangler=rustfilt target/debug/nargo -instr-profile=noir_tests.profdata -show-line-counts-or-regions -show-instantiations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
This directory includes scripts that help measure the test coverage of Noir. | ||
|
||
They should be run from the main directory of the repo like this: | ||
|
||
utils/test-coverage/0_cleanup.sh | ||
utils/test-coverage/1_test.sh | ||
... | ||
etc. | ||
|
||
Short description of what each of these scripts does: | ||
|
||
0_cleanup.sh: | ||
Cleans up the files from a previous test coverage measurement. | ||
|
||
1_test.sh: | ||
Runs the testsuite with test coverage measurement enabled. Testsuite run is | ||
about 8 times slower than normal. Produces lots of *.profraw files all over | ||
the place. A typical test run produced: 6,966,994 KiB in 1331 files | ||
|
||
2_profdata.sh: | ||
Combines all the *.profraw files into a single file, called | ||
'noir_tests.profdata'. | ||
|
||
3_cov.sh: | ||
Produces a test coverage report. What the test does is just an example. You | ||
can use the command, called by the script and modify its parameters, to | ||
produce all kinds of reports. For specific details, you should consult the | ||
documentation for the llvm-cov command. |