Skip to content

Commit

Permalink
Add a script for running unit tests
Browse files Browse the repository at this point in the history
- Description and pre-requisites are described inside the script.
  • Loading branch information
chanijjani committed Feb 16, 2024
1 parent 294354a commit 106e692
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions rust/rti/run_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

#############################################################
# Description: #
# This script is made for user convenience #
# and can be used to generate HTML reports of code coverage #
# when unit test cases are executed. #
#############################################################

# Prerequities
# 1. grcov <== cargo install grcov
# 2. llvm-tools-preview <== rustup component add llvm-tools-preview

rm -rf cargo-test-*

CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test

grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage

0 comments on commit 106e692

Please sign in to comment.