Skip to content

Commit

Permalink
Add Travis CI config.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssafejava committed Nov 27, 2013
1 parent 78bc007 commit 65dff4a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
@@ -1,4 +1,10 @@
language: node_js
node_js:
- 0.6
- 0.8
- "0.10"
- "0.8"
- "0.6"

services: rabbitmq

notifications:
email: false
14 changes: 2 additions & 12 deletions Makefile
@@ -1,16 +1,6 @@
NODE=`which node`
SERVER="localhost:5672"
THIS_DIR=$(shell pwd)

default: test

FAIL=echo FAIL
PASS=echo PASS

test:
@for i in test/test-*.js; do \
/bin/echo -n "$$i: "; \
$(NODE) $$i $(SERVER) > /dev/null && $(PASS) || $(FAIL); \
done
test:
./runTests.sh

.PHONY: test
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -42,4 +42,8 @@
{
"optimist": "~0.6.0"
}
, "scripts" :
{
"test": "make test"
}
}
20 changes: 20 additions & 0 deletions runTests.sh
@@ -0,0 +1,20 @@
#!/bin/bash

NODE=`which node`
FILES=test/test-*.js
EXITCODE=0

for test in $FILES
do
trap "echo Exited!; exit;" SIGINT SIGTERM
echo -n "$test: "
if $NODE $test > /dev/null; then
echo "PASS"
else
echo "FAIL"
EXITCODE=1
fi
done

# Exit with error if any tests didn't pass.
exit $EXITCODE

0 comments on commit 65dff4a

Please sign in to comment.