mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
check: simple Makefile target.
This makes it much easier to run all the test scripts. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
10
Makefile
10
Makefile
@@ -93,6 +93,16 @@ $(PROGRAMS): CFLAGS+=-I.
|
|||||||
|
|
||||||
default: $(PROGRAMS)
|
default: $(PROGRAMS)
|
||||||
|
|
||||||
|
# These don't work in parallel, so we open-code them
|
||||||
|
test-cli-tests: $(TEST_CLI_PROGRAMS)
|
||||||
|
cd test-cli; scripts/shutdown.sh 2>/dev/null || true
|
||||||
|
set -e; cd test-cli; for args in "" --steal --unilateral --htlc-onchain; do scripts/setup.sh && scripts/test.sh $$args && scripts/shutdown.sh; done
|
||||||
|
|
||||||
|
check: test-cli-tests
|
||||||
|
|
||||||
|
full-check: check $(TEST_PROGRAMS)
|
||||||
|
test/test_state_coverage
|
||||||
|
|
||||||
TAGS: FORCE
|
TAGS: FORCE
|
||||||
$(RM) TAGS; find . -name '*.[ch]' | xargs etags --append
|
$(RM) TAGS; find . -name '*.[ch]' | xargs etags --append
|
||||||
FORCE::
|
FORCE::
|
||||||
|
|||||||
@@ -26,8 +26,3 @@ scripts/generate-block.sh init
|
|||||||
A1=`scripts/get-new-address.sh`
|
A1=`scripts/get-new-address.sh`
|
||||||
TX=`$CLI sendmany "" "{ \"$A1\":0.01 }"`
|
TX=`$CLI sendmany "" "{ \"$A1\":0.01 }"`
|
||||||
scripts/generate-block.sh
|
scripts/generate-block.sh
|
||||||
|
|
||||||
# Find the inputs number corresponding to that 0.01 btc out
|
|
||||||
echo "Argument to test.sh:"
|
|
||||||
for i in $(seq 1 $($CLI listunspent | grep -c txid) ); do scripts/getinput.sh $i | grep -q "$TX.*/1000000/" && echo -n "$i "; done
|
|
||||||
echo
|
|
||||||
|
|||||||
6
test-cli/scripts/shutdown.sh
Executable file
6
test-cli/scripts/shutdown.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#! /bin/sh -e
|
||||||
|
|
||||||
|
. `dirname $0`/vars.sh
|
||||||
|
|
||||||
|
$CLI stop
|
||||||
|
sleep 1 # Make sure socket is closed.
|
||||||
@@ -44,15 +44,23 @@ send_after_delay()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# = 0 ]; then
|
if [ x$1 != x ] && [ x$1 != x--steal ] && [ x$1 != x--unilateral ] && [ x$1 != x--htlc-onchain ]; then
|
||||||
echo Usage: "INPUT" "[--steal|--unilateral|--htlc-onchain]" >&2
|
echo Usage: "[--steal|--unilateral|--htlc-onchain]" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
A_INPUTNUM=$1
|
# Find the inputs number corresponding to that 0.01 btc out
|
||||||
shift
|
for i in $(seq 1 $($CLI listunspent | grep -c txid) ); do
|
||||||
#A_INPUTNUM=4
|
if scripts/getinput.sh $i | grep -q "$TX.*/1000000/"; then
|
||||||
#B_INPUTNUM=1
|
A_INPUTNUM=$i;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$A_INPUTNUM" ]; then
|
||||||
|
echo "Can't find 1000000 satoshi input" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
A_AMOUNT=900000
|
A_AMOUNT=900000
|
||||||
|
|
||||||
A_CHANGEADDR=`scripts/get-new-address.sh`
|
A_CHANGEADDR=`scripts/get-new-address.sh`
|
||||||
|
|||||||
Reference in New Issue
Block a user