Skip to content

Commit

Permalink
Have the makefile start the server.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed Nov 13, 2012
1 parent ec0344a commit 7349d29
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
language: node_js
before_script: "test/serve.sh 8080 &"
script: "cd test; make"
14 changes: 9 additions & 5 deletions test/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@

test_port=8081
test: basic none

basic:
phantomjs basic.js 8080
basic: server
phantomjs basic.js $(test_port)

none:
phantomjs none.js 8080
none: server
phantomjs none.js $(test_port)

lint:
jslint --terse ../hinclude.js
jslint --terse ../hinclude.js

server:
./serve.sh $(test_port)
3 changes: 1 addition & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ Note that jslint is most easily installed with [npm](http://npmjs.org/).
Before the suite is run, start a server:

> ./serve.sh&
Make sure to stop and restart the server when there are changes to hinclude.
2 changes: 1 addition & 1 deletion test/assets/hinclude.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
hinclude.js -- HTML Includes (version 0.9.2)
hinclude.js -- HTML Includes (version 0.9.5)
Copyright (c) 2005-2011 Mark Nottingham <mnot@mnot.net>
Expand Down
8 changes: 7 additions & 1 deletion test/serve.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash

PORT=$1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cp -f $DIR/../hinclude.js $DIR/assets/
cd $DIR/assets; python -m SimpleHTTPServer 8080 2>/dev/null

cd $DIR/assets

echo "Starting server on $PORT" >/dev/stderr
python -m SimpleHTTPServer $PORT 2>/dev/null &
echo "PID $!"

0 comments on commit 7349d29

Please sign in to comment.