Support a ./cli script which provides a full-path to the freshly-compiled whck
This commit is contained in:
parent
e02cea8762
commit
3a5ef03130
|
@ -0,0 +1,22 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
SCRIPTDIR="$(dirname "$0")"
|
||||
|
||||
if [ -f "$SCRIPTDIR"/target/release/whck ]; then
|
||||
output="$(cargo build --release 2>&1)"
|
||||
if [ $? -eq 0 ]; then
|
||||
# Build succeeded echo path to binary
|
||||
echo "$SCRIPTDIR"/target/release/whck
|
||||
else
|
||||
echo "$output"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
output="$(cargo build 2>&1)"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "$SCRIPTDIR"/target/debug/whck
|
||||
else
|
||||
echo "$output"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
2
spec
2
spec
|
@ -1 +1 @@
|
|||
Subproject commit 71804c4b3a5f19bb53fdab0bbcecb39ed0919aca
|
||||
Subproject commit 9b18c0e162a904f6760fb8ce6516f71c883f75d8
|
17
test.sh
17
test.sh
|
@ -5,7 +5,7 @@ ORIGDIR="$(pwd)"
|
|||
|
||||
if [ ! -f "$SCRIPTDIR"/spec/test_cli.sh ]; then
|
||||
echo "Submodule not cloned yet. Doing it now"
|
||||
cd $SCRIPTDIR
|
||||
cd "$SCRIPTDIR"
|
||||
git submodule init
|
||||
if ! git submodule update; then
|
||||
echo "Failed to download submodules. Are you connected to the internet?"
|
||||
|
@ -13,12 +13,17 @@ if [ ! -f "$SCRIPTDIR"/spec/test_cli.sh ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$SCRIPTDIR"/target/release/whck ]; then
|
||||
cargo build --release
|
||||
"$SCRIPTDIR"/spec/test_cli.sh "$SCRIPTDIR"/target/release/whck
|
||||
# If ./cli succeeds, it contains a path to the executable
|
||||
# Otherwise it may contain build error messages
|
||||
executable="$("$SCRIPTDIR"/cli)"
|
||||
if [ $? -eq 0 ]; then
|
||||
"$SCRIPTDIR"/spec/test_cli.sh "$executable"
|
||||
status=$?
|
||||
else
|
||||
cargo build
|
||||
"$SCRIPTDIR"/spec/test_cli.sh "$SCRIPTDIR"/target/debug/whck
|
||||
status=1
|
||||
echo "Build failed. OUTPUT:"
|
||||
echo "$output"
|
||||
fi
|
||||
|
||||
cd "$ORIGDIR"
|
||||
exit $status
|
||||
|
|
Loading…
Reference in New Issue