Skip to content

Instantly share code, notes, and snippets.

@andyvanee
Created July 7, 2011 21:40
Show Gist options
  • Select an option

  • Save andyvanee/1070612 to your computer and use it in GitHub Desktop.

Select an option

Save andyvanee/1070612 to your computer and use it in GitHub Desktop.
Makefile for node test and run
.PHONY: test
test:
@ echo ### App Server Starting; echo
@ node app.js >> tst_log.txt 2>&1 &
@ echo; echo '### Running Zombie Tests'; echo
@ sleep 1; node test-http/zombie_tests.js
@ echo; echo '### Shutting Down App Server'; echo
@ killall node
@ rm tst_log.txt
@ echo; echo '### Running nodeunit Tests'; echo
@./run_tests.js
run:
@ sudo pwd ##Prompt for sudo password, so the following will succeed
@ sudo killall node > log.txt 2>&1 &
@ sleep 0.4; sudo NODE_ENV=production node app.js 80 >> log.txt 2>&1 &
@ echo Node server running on port 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment