add build helper scripts
This commit is contained in:
parent
c69ccbb9c2
commit
fc70057e7e
2 changed files with 35 additions and 0 deletions
32
scripts/test
Executable file
32
scripts/test
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
USAGE='test [[run]-[valgrind]] ...'
|
||||
if [[ "$1" =~ help ]]; then
|
||||
echo "$USAGE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# === ARGPARSE
|
||||
MODE=
|
||||
REBUILD=true
|
||||
VALGRIND=false
|
||||
TARGET=all
|
||||
if [[ "$1" =~ run.* ]]; then
|
||||
MODE="$1"
|
||||
REBUILD=false
|
||||
fi
|
||||
if [[ "$1" =~ .*valgrind ]]; then
|
||||
MODE="$1"
|
||||
VALGRIND=true
|
||||
PROXY='valgrind -s --leak-check=full --show-leak-kinds=all'
|
||||
TARGET=debug
|
||||
fi
|
||||
|
||||
if [[ -n "$MODE" ]]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
# === MAIN
|
||||
if [[ "$REBUILD" == true ]]; then
|
||||
make clean $TARGET
|
||||
fi
|
||||
LD_LIBRARY_PATH=./lib $PROXY ./cursed $@
|
||||
Loading…
Add table
Add a link
Reference in a new issue