2023-06-08 19:38:26 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-01-20 17:43:23 +00:00
|
|
|
set -e
|
2023-01-12 23:23:58 +00:00
|
|
|
|
2023-06-30 07:50:30 +00:00
|
|
|
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
|
|
|
|
cd $CWD/../
|
|
|
|
|
2023-01-12 23:23:58 +00:00
|
|
|
PACKAGE="$1"
|
|
|
|
echo "$PACKAGE"
|
2020-12-11 14:56:20 +00:00
|
|
|
|
2023-06-30 07:50:30 +00:00
|
|
|
source scripts/start_dev_db.sh
|
2021-02-04 16:34:58 +00:00
|
|
|
|
2021-04-05 17:21:56 +00:00
|
|
|
# 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
|
2023-01-12 23:23:58 +00:00
|
|
|
export RUST_BACKTRACE=1
|
|
|
|
|
|
|
|
if [ -n "$PACKAGE" ];
|
|
|
|
then
|
|
|
|
cargo test -p $PACKAGE --all-features --no-fail-fast
|
|
|
|
else
|
2023-01-30 19:17:24 +00:00
|
|
|
cargo test --workspace --no-fail-fast
|
2023-01-12 23:23:58 +00:00
|
|
|
fi
|
|
|
|
|
2022-07-30 03:55:59 +00:00
|
|
|
# Add this to do printlns: -- --nocapture
|
2023-06-30 07:50:30 +00:00
|
|
|
|
|
|
|
pg_ctl stop
|
|
|
|
rm -rf $PGDATA
|