From 208beab52948d235994ec0529a9de572eb3c751e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 8 Nov 2016 21:52:55 +1030 Subject: [PATCH] test: setup bitcoind once, then run lightning tests. On my build machine, times are: Before: real 22m10.425s After: real 17m56.862s Signed-off-by: Rusty Russell --- daemon/test/Makefile | 15 ++++++++++++--- daemon/test/scripts/setup.sh | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/daemon/test/Makefile b/daemon/test/Makefile index cb4355e58..71371f52a 100644 --- a/daemon/test/Makefile +++ b/daemon/test/Makefile @@ -1,7 +1,6 @@ check: daemon-tests daemon-test.sh-%: - daemon/test/scripts/shutdown.sh 2>/dev/null || true NO_VALGRIND=$(NO_VALGRIND) daemon/test/test.sh --$* # These don't work in parallel, so chain the deps @@ -24,8 +23,18 @@ daemon-test.sh-dump-onchain\ --restart: daemon-test.sh-timeout-anchor\ --restart daemon-test.sh-timeout-anchor\ --restart: daemon-test.sh-different-fee-rates\ --restart daemon-test.sh-different-fee-rates\ --restart: daemon-test.sh-normal\ --restart daemon-test.sh-normal\ --restart: daemon-test.sh-mutual-close-with-htlcs\ --restart -daemon-test.sh-mutual-close-with-htlcs\ --restart: daemon-all -daemon-all-test.sh: daemon-test.sh-steal +daemon-test.sh-mutual-close-with-htlcs\ --restart: daemon-test-setup + +# We shutdown first in case something is left over. +daemon-test-setup: daemon-all + daemon/test/scripts/shutdown.sh 2>/dev/null || true + daemon/test/scripts/setup.sh + +daemon-test-shutdown: daemon-test.sh-steal + daemon/test/scripts/shutdown.sh + +# Forms a long dependency chain. +daemon-all-test.sh: daemon-test-shutdown # Note that these actually #include everything they need, except ccan/ and bitcoin/. # That allows for unit testing of statics, and special effects. diff --git a/daemon/test/scripts/setup.sh b/daemon/test/scripts/setup.sh index 1057ad589..8ea494a89 100755 --- a/daemon/test/scripts/setup.sh +++ b/daemon/test/scripts/setup.sh @@ -45,8 +45,8 @@ else exit 1 fi -scripts/generate-block.sh init +`dirname $0`/generate-block.sh init -A1=`scripts/get-new-address.sh` +A1=$(`dirname $0`/get-new-address.sh) TX=`$CLI sendmany "" "{ \"$A1\":0.01 }"` -scripts/generate-block.sh +`dirname $0`/generate-block.sh