From 54cc3a383e4ae80cd644b740f8111296a3de16a7 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 11 Aug 2016 01:40:03 -0700 Subject: [PATCH] [Tests] set -ex options on more tests --- test/installation_node/install from source | 16 +++++++++++----- .../install from source implicitly | 8 +++++++- test/slow/node 0.6.21 should install 0.6.21-pre | 2 ++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/test/installation_node/install from source b/test/installation_node/install from source index eccdbba..1d4fa39 100755 --- a/test/installation_node/install from source +++ b/test/installation_node/install from source @@ -1,23 +1,29 @@ #!/bin/sh +set -ex + die () { echo $@ ; exit 1; } +set +e # TODO: fix . ../../nvm.sh +set -e + +nvm deactivate || die 'deactivate failed' nvm unalias default || die 'unable to unalias default' NVM_TEST_VERSION=v0.10.7 # Remove the stuff we're clobbering. -[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION +nvm uninstall "${NVM_TEST_VERSION}" || die 'nvm uninstall failed' # Install from source -nvm install -s $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" +nvm install -s "${NVM_TEST_VERSION}" || die "'nvm install -s ${NVM_TEST_VERSION}' failed" # Check -[ -d ../../$NVM_TEST_VERSION ] -nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" +[ -d ../../$NVM_TEST_VERSION ] || die "../../${NVM_TEST_VERSION} is not a directory" +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || "'nvm run ${NVM_TEST_VERSION} --version | grep ${NVM_TEST_VERSION}' failed" # ensure default is set NVM_CURRENT_DEFAULT="$(nvm_alias default)" -[ "$NVM_CURRENT_DEFAULT" = "$NVM_TEST_VERSION" ] || die "wrong default alias: $(nvm alias)" +[ "${NVM_CURRENT_DEFAULT}" = "${NVM_TEST_VERSION}" ] || die "wrong default alias: $(nvm alias)" diff --git a/test/installation_node/install from source implicitly b/test/installation_node/install from source implicitly index f5763f4..7b01178 100755 --- a/test/installation_node/install from source implicitly +++ b/test/installation_node/install from source implicitly @@ -1,13 +1,19 @@ #!/bin/sh +set -ex + die () { echo $@ ; exit 1; } +set +e # TODO: fix . ../../nvm.sh +set -e + +nvm deactivate || die 'deactivate failed' NVM_TEST_VERSION=v0.8.5 # Remove the stuff we're clobbering. -[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION +nvm uninstall "${NVM_TEST_VERSION}" || die 'uninstall failed' # Install from source implicitly (v0.8.6 is when binaries started) nvm install $NVM_TEST_VERSION || die "'nvm install -s $NVM_TEST_VERSION' failed" diff --git a/test/slow/node 0.6.21 should install 0.6.21-pre b/test/slow/node 0.6.21 should install 0.6.21-pre index 93afff7..fd98aa9 100755 --- a/test/slow/node 0.6.21 should install 0.6.21-pre +++ b/test/slow/node 0.6.21 should install 0.6.21-pre @@ -1,5 +1,7 @@ #!/bin/sh +set -ex + die () { echo $@ ; exit 1; } . ../../nvm.sh