Skip to content

Instantly share code, notes, and snippets.

@tj
Created October 20, 2011 00:36
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tj/1300101 to your computer and use it in GitHub Desktop.
Save tj/1300101 to your computer and use it in GitHub Desktop.
tiny bash test runner
TESTS = $(shell find test/test.*.js)
test:
@./test/run.sh $(TESTS)
.PHONY: test
#!/usr/bin/env bash
echo
for file in $@; do
printf "\033[90m ${file#test/}\033[0m "
node $file && printf "\033[36m✓\033[0m\n"
test $? -eq 0 || exit $?
done
echo
$ make test
test.exports.js ✓
test.socket.events.js ✓
test.socket.js ✓
test.socket.messages.js ✓
test.socket.pub-sub.filter.js ✓
test.socket.pub-sub.js ✓
test.socket.req-rep.js ✓
test.socket.req-rep.multiple.js ✓
test.socket.sndmore.js ✓
@dshaw
Copy link

dshaw commented Oct 20, 2011

Hot!

@craigbarnes
Copy link

You can get free parallel execution with this + make -j2 test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment