Permalink
Browse files

makefile: update to seperate testing

  • Loading branch information...
1 parent b144488 commit 1d0f905537c459efcbb0af585a02ca1b3c004317 @logicalparadox logicalparadox committed Feb 14, 2013
Showing with 42 additions and 11 deletions.
  1. +42 −11 Makefile
View
53 Makefile
@@ -1,33 +1,64 @@
+
TESTS = test/*.js
REPORTER = spec
-build: components
- @./node_modules/.bin/component-build --dev
+#
+# Tests
+#
-components:
- @./node_modules/.bin/component-install --dev
+test: test-node test-browser
-test: build
+test-node:
@printf "\n ==> [Node.js]"
@NODE_ENV=test ./node_modules/.bin/mocha \
--require ./test/bootstrap \
--reporter $(REPORTER) \
$(TESTS)
+
+test-browser: build
@printf "\n ==> [Phantom.Js]"
@./node_modules/.bin/mocha-phantomjs \
--R ${REPORTER} \
./test/browser/index.html
test-cov: lib-cov
- @queue_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+ @ms_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
+ --require ./test/bootstrap \
+ --reporter html-cov \
+ $(TESTS) \
+ > coverage.html
-lib-cov: clean
- @jscoverage lib lib-cov
+#
+# Components
+#
+
+build: components lib/*
+ @./node_modules/.bin/component-build --dev
+
+components: component.json
+ @./node_modules/.bin/component-install --dev
-clean:
+#
+# Coverage
+#
+
+lib-cov:
@rm -rf lib-cov
- @rm -f coverage.html
+ @jscoverage lib lib-cov
+
+#
+# Clean up
+#
+
+clean: clean-components clean-cov
+
+clean-components:
@rm -rf build
@rm -rf components
-.PHONY: build test lib-cov test-cov clean
+clean-cov:
+ @rm -rf lib-cov
+ @rm -f coverage.html
+
+
+.PHONY: clean clean-components clean-cov test test-cov test-node test-browser lib-cov

0 comments on commit 1d0f905

Please sign in to comment.