2020-11-04 11:03:33 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Let's work with absolute paths only, we run in the itest directory itself.
|
2022-08-11 13:39:40 +02:00
|
|
|
WORKDIR=$(pwd)/itest
|
2020-11-04 11:03:33 +01:00
|
|
|
|
|
|
|
TRANCHE=$1
|
|
|
|
NUM_TRANCHES=$2
|
|
|
|
|
|
|
|
# Shift the passed parameters by two, giving us all remaining testing flags in
|
|
|
|
# the $@ special variable.
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
|
|
|
|
# Windows insists on having the .exe suffix for an executable, we need to add
|
|
|
|
# that here if necessary.
|
|
|
|
EXEC="$WORKDIR"/itest.test"$EXEC_SUFFIX"
|
|
|
|
LND_EXEC="$WORKDIR"/lnd-itest"$EXEC_SUFFIX"
|
2020-12-03 11:30:27 +01:00
|
|
|
BTCD_EXEC="$WORKDIR"/btcd-itest"$EXEC_SUFFIX"
|
2023-01-26 11:35:43 +01:00
|
|
|
export GOCOVERDIR="$WORKDIR/cover"
|
|
|
|
mkdir -p "$GOCOVERDIR"
|
2024-08-23 09:48:09 +02:00
|
|
|
echo $EXEC "$@" -logoutput -logdir=.logs-tranche$TRANCHE -lndexec=$LND_EXEC -btcdexec=$BTCD_EXEC -splittranches=$NUM_TRANCHES -runtranche=$TRANCHE
|
2020-11-04 11:03:33 +01:00
|
|
|
|
|
|
|
# Exit code 255 causes the parallel jobs to abort, so if one part fails the
|
|
|
|
# other is aborted too.
|
|
|
|
cd "$WORKDIR" || exit 255
|
2024-08-23 09:48:09 +02:00
|
|
|
$EXEC "$@" -logoutput -logdir=.logs-tranche$TRANCHE -lndexec=$LND_EXEC -btcdexec=$BTCD_EXEC -splittranches=$NUM_TRANCHES -runtranche=$TRANCHE || exit 255
|