mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-09 00:49:21 +00:00
add test-with-coverage.sh
This commit is contained in:
parent
121cae2cd0
commit
b1a1398f7e
24
scripts/test-with-coverage.sh
Executable file
24
scripts/test-with-coverage.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||
|
||||
cd $CWD/../
|
||||
|
||||
PACKAGE="$1"
|
||||
echo "$PACKAGE"
|
||||
|
||||
source scripts/start_dev_db.sh
|
||||
|
||||
# tests are executed in working directory crates/api (or similar),
|
||||
# so to load the config we need to traverse to the repo root
|
||||
export LEMMY_CONFIG_LOCATION=../../config/config.hjson
|
||||
export RUST_BACKTRACE=1
|
||||
|
||||
cargo install cargo-llvm-cov
|
||||
cargo llvm-cov --workspace --all-features --no-fail-fast --lcov --output-path lcov.info
|
||||
|
||||
# Add this to do printlns: -- --nocapture
|
||||
|
||||
pg_ctl stop --silent
|
||||
rm -rf $PGDATA
|
Loading…
Reference in a new issue