Skip to content

Commit

Permalink
Merge pull request #29 from hokeun/unit_test_script
Browse files Browse the repository at this point in the history
Add a script for running unit tests
  • Loading branch information
chanijjani authored Feb 17, 2024
2 parents a12ffec + 106e692 commit 0a44e5c
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 0a44e5c

Please sign in to comment.