Skip to content

Commit 635bbf9

Browse files
authored
Josh.wang/jenkins/start devel test script (#38)
* write unit tests for travis test cases.
1 parent fffe012 commit 635bbf9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Scripts/ci_unit_tests.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# cannot use `set -e` because it is incompatible with nvm
3+
4+
# download nvm and load it
5+
export NVM_DIR="`pwd`/.nvm" # truly local nvm install not needing sudo
6+
mkdir -p $NVM_DIR
7+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
8+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
9+
10+
function run_tests () {
11+
echo "Installing node" $1
12+
nvm install $1
13+
nvm exec $1 npm install
14+
response=$?
15+
if [[ $response != 0 ]]; then exit $response; fi
16+
nvm exec $1 npm test
17+
response=$?
18+
if [[ $response != 0 ]]; then exit $response; fi
19+
}
20+
21+
# install node 5; run tests
22+
run_tests 5
23+
24+
# install node 0.10; run tests
25+
run_tests 0.10
26+
27+
# install node; run tests
28+
run_tests node

0 commit comments

Comments
 (0)