diff --git a/scripts/mk b/scripts/mk new file mode 100755 index 0000000..1eff358 --- /dev/null +++ b/scripts/mk @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +$([ -x "$(command -v bear)" ] && echo 'bear -- ') make $@ + diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000..ed3dcba --- /dev/null +++ b/scripts/test @@ -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 $@