From 88ce2103f5f56de992e06a06b70b3ea94d20fb68 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 26 May 2016 08:48:15 +0200 Subject: [PATCH] Use `watch` to keepalive stdout while installing. --- test/common.sh | 12 ++++++++++++ test/installation_iojs/install from source | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/test/common.sh b/test/common.sh index 033817c..98be7b3 100644 --- a/test/common.sh +++ b/test/common.sh @@ -63,3 +63,15 @@ make_fake_iojs() { return 3 } } + +watch() { + $@ & + local JOB + JOB=$! + while true; do sleep 15; echo '* ping *'; done & + wait $JOB; + local EXIT_CODE + EXIT_CODE=$? + kill %2; + return $EXIT_CODE +} diff --git a/test/installation_iojs/install from source b/test/installation_iojs/install from source index 7b44643..5496b2c 100755 --- a/test/installation_iojs/install from source +++ b/test/installation_iojs/install from source @@ -1,5 +1,7 @@ #!/bin/sh +. ../common.sh + die () { echo $@ ; exit 1; } . ../../nvm.sh @@ -11,7 +13,7 @@ NVM_PREFIXED_TEST_VERSION="iojs-$NVM_TEST_VERSION" [ -e ../../versions/io.js/$NVM_TEST_VERSION ] && rm -R ../../versions/io.js/$NVM_TEST_VERSION # Install from source -nvm install -s $NVM_PREFIXED_TEST_VERSION || die "'nvm install -s $NVM_PREFIXED_TEST_VERSION' failed" +(watch nvm install -s $NVM_PREFIXED_TEST_VERSION) || die "'nvm install -s $NVM_PREFIXED_TEST_VERSION' failed" # Check [ -d ../../versions/io.js/$NVM_TEST_VERSION ]