From 3403795c8600bc63a6e36011aed30fd391f7c96e Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 18 Dec 2020 13:27:21 +0100 Subject: [PATCH] tests: add example scripts --- examples/deploy-qemu-vm.sh | 2 ++ test/run-tests.sh | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/examples/deploy-qemu-vm.sh b/examples/deploy-qemu-vm.sh index e155126..331451f 100755 --- a/examples/deploy-qemu-vm.sh +++ b/examples/deploy-qemu-vm.sh @@ -17,6 +17,8 @@ if [[ ! -v IN_NIX_SHELL ]]; then exec nix-shell --run "./${BASH_SOURCE[0]##*/} $*" fi +cd "${BASH_SOURCE[0]%/*}" + tmpDir=/tmp/nix-bitcoin-qemu-vm mkdir -p $tmpDir diff --git a/test/run-tests.sh b/test/run-tests.sh index ba3f5a5..5b24a33 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -202,13 +202,29 @@ basic() { pkgsUnstable } -all() { +# All tests that only consist of building a nix derivation. +# Their output is cached in /nix/store. +buildable() { basic scenario=full buildTest "$@" scenario=regtest buildTest "$@" scenario=hardened buildTest "$@" } +examples() { + script=" + set -e + ./deploy-container.sh + ./deploy-qemu-vm.sh + " + (cd $scriptDir/../examples && nix-shell --run "$script") +} + +all() { + buildable + examples +} + # An alias for buildTest build() { buildTest "$@"