From 106e692ed329538b50515bf8834ad8df5ff2868d Mon Sep 17 00:00:00 2001 From: Chanhee Lee Date: Thu, 8 Feb 2024 12:39:39 -0700 Subject: [PATCH] Add a script for running unit tests - Description and pre-requisites are described inside the script. --- rust/rti/run_unit_tests.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 rust/rti/run_unit_tests.sh diff --git a/rust/rti/run_unit_tests.sh b/rust/rti/run_unit_tests.sh new file mode 100755 index 0000000..ff6a829 --- /dev/null +++ b/rust/rti/run_unit_tests.sh @@ -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