+ Created testing func which is now super easily configurable

! This lets me specify between release and debug testing now yey
This commit is contained in:
shockrah 2020-11-21 19:05:02 -08:00
parent acbbaab68d
commit f5f3df2ee2

View File

@ -5,6 +5,7 @@ cat <<EOF
Usage: ./build.sh [-h|-t|-b|-r]
h Help : shows this command
t Test : Runs All tests from cargo tests to client tests
T Test Realse : Runs tests against release build
b Build : Builds dev build with 'cargo build'
r Release : Builds release build with --release flag
EOF
@ -12,21 +13,26 @@ EOF
[[ -z $1 ]] && _help && exit 0
while getopts ":htbr" arg; do
case ${arg} in
h)echo help command;;
t)
cargo build
cargo run -- -s &
server=$!
echo Waiting on server to spin up && sleep 2
export CARGO_BIN=$HOME/.cargo/bin/cargo
export CARGO_BIN=$HOME/.cargo/bin/cargo
python3 client-tests/client.py
kill -9 $server
;;
b)cargo build;;
r)cargo build --release;;
testing() {
release_opt=$1
cargo build $release_opt
cargo run $release_opt -- -s &
server=$!
echo Waiting on server to spin up && sleep 2
python3 client-tests/client.py
kill -9 $server
}
while getopts ":htTbr" arg; do
case ${arg} in
h) echo help command;;
t) testing;;
T) testing --release;;
b) cargo build;;
r) cargo build --release;;
*) _help;;
esac
done