From 1931f7f3f83f914f194595d26ae91f3746254203 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 3 Oct 2014 02:35:39 -0700 Subject: [PATCH] Remove '-e' option from installation tests, in favor of explicit failures. --- test/installation/install from binary | 7 ++++--- test/installation/install from source | 7 ++++--- .../install two versions and use the latest one | 17 +++++++++-------- ...tall version specified in .nvmrc from binary | 10 ++++++---- ...tall version specified in .nvmrc from source | 10 ++++++---- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/test/installation/install from binary b/test/installation/install from binary index 9138933..cdc0e7a 100755 --- a/test/installation/install from binary +++ b/test/installation/install from binary @@ -1,6 +1,7 @@ #!/bin/sh -set -e +die () { echo $@ ; exit 1; } + . ../../nvm.sh NVM_TEST_VERSION=v0.10.7 @@ -9,9 +10,9 @@ NVM_TEST_VERSION=v0.10.7 [ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION # Install from binary -nvm install $NVM_TEST_VERSION +nvm install $NVM_TEST_VERSION || die "install $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 || die "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" diff --git a/test/installation/install from source b/test/installation/install from source index a535b75..25a0f1e 100755 --- a/test/installation/install from source +++ b/test/installation/install from source @@ -1,6 +1,7 @@ #!/bin/sh -set -e +die () { echo $@ ; exit 1; } + . ../../nvm.sh NVM_TEST_VERSION=v0.10.7 @@ -9,9 +10,9 @@ NVM_TEST_VERSION=v0.10.7 [ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION # Install from source -nvm install -s $NVM_TEST_VERSION +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 || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" diff --git a/test/installation/install two versions and use the latest one b/test/installation/install two versions and use the latest one index 9f50510..77dc9e4 100755 --- a/test/installation/install two versions and use the latest one +++ b/test/installation/install two versions and use the latest one @@ -1,6 +1,7 @@ #!/bin/sh -set -e +die () { echo $@ ; exit 1; } + . ../../nvm.sh # Remove the stuff we're clobbering. @@ -8,17 +9,17 @@ set -e [ -e ../../v0.9.12 ] && rm -R ../../v0.9.12 # Install from binary -nvm install 0.9.7 -nvm i 0.9.12 +nvm install 0.9.7 || die "'nvm install 0.9.7' failed" +nvm i 0.9.12 || die "'nvm i 0.9.12' failed" # Check -[ -d ../../v0.9.7 ] -[ -d ../../v0.9.12 ] +[ -d ../../v0.9.7 ] || die "v0.9.7 didn't exist" +[ -d ../../v0.9.12 ] || die "v0.9.12 didn't exist" # Use the first one -nvm use 0.9.7 +nvm use 0.9.7 || die "'nvm use 0.9.7' failed" # Use the latest one -nvm use 0.9 -node --version | grep v0.9.12 +nvm use 0.9 || die "'nvm use 0.9' failed" +node --version | grep v0.9.12 || die "'node --version' was not v0.9.12, got: $(node --version)" diff --git a/test/installation/install version specified in .nvmrc from binary b/test/installation/install version specified in .nvmrc from binary index b261970..ad5f296 100755 --- a/test/installation/install version specified in .nvmrc from binary +++ b/test/installation/install version specified in .nvmrc from binary @@ -1,6 +1,7 @@ #!/bin/sh -set -e +die () { echo $@ ; exit 1; } + . ../../nvm.sh NVM_TEST_VERSION=v0.10.7 @@ -11,10 +12,11 @@ NVM_TEST_VERSION=v0.10.7 # Install from binary echo "$NVM_TEST_VERSION" > .nvmrc -nvm install +nvm install || die "'nvm install' failed" # Check -[ -d ../../$NVM_TEST_VERSION ] -nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION +[ -d ../../$NVM_TEST_VERSION ] || die "./$NVM_TEST_VERSION did not exist" +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION \ + || "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed" diff --git a/test/installation/install version specified in .nvmrc from source b/test/installation/install version specified in .nvmrc from source index 5544d0e..63ea0ea 100755 --- a/test/installation/install version specified in .nvmrc from source +++ b/test/installation/install version specified in .nvmrc from source @@ -1,6 +1,7 @@ #!/bin/sh -set -e +die () { echo $@ ; exit 1; } + . ../../nvm.sh NVM_TEST_VERSION=v0.10.7 @@ -11,10 +12,11 @@ NVM_TEST_VERSION=v0.10.7 # Install from binary echo "$NVM_TEST_VERSION" > .nvmrc -nvm install -s +nvm install -s || "'nvm install -s' failed" # Check -[ -d ../../$NVM_TEST_VERSION ] -nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION +[ -d ../../$NVM_TEST_VERSION ] || die "$NVM_TEST_VERSION did not exist" +nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION \ + || die "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed"