aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-06-27 19:28:37 +0200
committerJames Lal <james@lightsofapollo.com>2012-06-27 19:28:37 +0200
commitd76e26ac16c16ca30a9c177fa292f5cdf184955e (patch)
treefbc9e6df292440b689d1990911edd802e618df43 /Makefile
parent1c136b249274a3cad047e043693c6e643892b6a9 (diff)
downloadjsCalDAV-d76e26ac16c16ca30a9c177fa292f5cdf184955e.tar.gz
initial move to support web js
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 37 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5d798da..29ee741 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,16 @@
-REPORTER := spec
+REPORTER=spec
+WEB_FILE=webcals.js
+VENDOR=./vendor/
+
+.PHONY: package
+package: test-agent-config
+ rm -Rf $(VENDOR)/
+ mkdir $(VENDOR)
+ cp ./node_modules/mocha/mocha.js $(VENDOR)
+ cp ./node_modules/mocha/mocha.css $(VENDOR)
+ cp ./node_modules/chai/chai.js $(VENDOR)
+ cp ./node_modules/test-agent/test-agent.js $(VENDOR)
+ cp ./node_modules/test-agent/test-agent.css $(VENDOR)
.PHONY: test
test:
@@ -11,6 +23,26 @@ test:
test/webcals/request/*_test.js \
test/webcals/*_test.js
+TEST_AGENT_CONFIG=./test-agent/config.json
+.PHONY: test-agent-config
+test-agent-config:
+ @rm -f $(TEST_AGENT_CONFIG)
+ @touch $(TEST_AGENT_CONFIG)
+ @rm -f /tmp/test-agent-config;
+ # Build json array of all test files
+ for d in test; \
+ do \
+ find $$d -name '*_test.js' | sed "s:$$d/::g" >> /tmp/test-agent-config; \
+ done;
+ @echo '{"tests": [' >> $(TEST_AGENT_CONFIG)
+ @cat /tmp/test-agent-config | \
+ sed 's:\(.*\):"\1":' | \
+ sed -e ':a' -e 'N' -e '$$!ba' -e 's/\n/,\
+ /g' >> $(TEST_AGENT_CONFIG);
+ @echo ' ]}' >> $(TEST_AGENT_CONFIG);
+ @echo "Built test ui config file: $(TEST_AGENT_CONFIG)"
+ @rm -f /tmp/test-agent-config
+
.PHONY: watch
FILES=
watch:
@@ -20,3 +52,7 @@ watch:
--watch \
--growl \
test/helper.js $(FILES)
+
+.PHONY: test-server
+test-server:
+ ./node_modules/test-agent/bin/js-test-agent server --growl