<commit_before>
# note - this needs to be default so that the nodeunit process will exit with
# error if tests fail. Otherwise make will not abort.
REPORTER = default 

LINT    = ./node_modules/.bin/jslint --indent 2 --white --nomen
FOREVER = ./node_modules/.bin/forever

WAIT_FOR_SERVER   = sleep 5 # FIXME - use something more elegant
START_TEST_SERVER = NODE_ENV=testing $(FOREVER) start server.js && $(WAIT_FOR_SERVER)
STOP_TEST_SERVER  = $(FOREVER) stop server.js


all: npm-install


npm-install:
	npm install

npm-update:
	rm npm-shrinkwrap.json
	npm update
	npm shrinkwrap


lint:
	find lib          -name '*.js' | xargs -n 1 $(LINT) --node --
	find instance-app -name '*.js' | xargs -n 1 $(LINT) --node --
	find hosting-app  -name '*.js' | xargs -n 1 $(LINT) --node --
	find public/js    -name '*.js' | xargs -n 1 $(LINT) --browser --


scss:
	compass compile

minify:
	rm -rf public-minified
	node_modules/.bin/r.js -o public/js/app.build.js
	rm    public-minified/build.txt
	rm    public-minified/js/app.build.js 
	rm -r public-minified/sass/


tidy:
	# this should tidy, but not implemented yet
	# The output is not as nice as I'd like
	# sass-convert --recursive --in-place --from scss --to scss public/sass/


test: npm-install test-unit test-api test-selenium

test-unit:
	@NODE_ENV=testing ./node_modules/.bin/nodeunit \
		--reporter $(REPORTER) \
		tests/unit


test-selenium: scss minify
	@NODE_ENV=testing ./node_modules/.bin/nodeunit \
		--reporter $(REPORTER) \
		tests/selenium


test-browser: scss minify
	$(START_TEST_SERVER)
	@NODE_ENV=testing ruby tests/browser_based/run_tests.rb
	$(STOP_TEST_SERVER)
	echo "ALL TESTS PASSED"


test-api:
	@NODE_ENV=testing ./node_modules/.bin/nodeunit \
		--reporter $(REPORTER) \
		tests/api

clean:
	rm -rfv .sass-cache


.PHONY: test test-unit test-selenium test-api scss minify clean tidy npm-install npm-update

<commit_msg>Run the watir tests from the makefile<commit_after>
# note - this needs to be default so that the nodeunit process will exit with
# error if tests fail. Otherwise make will not abort.
REPORTER = default 

LINT    = ./node_modules/.bin/jslint --indent 2 --white --nomen
FOREVER = ./node_modules/.bin/forever

WAIT_FOR_SERVER   = sleep 5 # FIXME - use something more elegant
START_TEST_SERVER = NODE_ENV=testing $(FOREVER) start server.js && $(WAIT_FOR_SERVER)
STOP_TEST_SERVER  = $(FOREVER) stop server.js


all: npm-install


npm-install:
	npm install

npm-update:
	rm npm-shrinkwrap.json
	npm update
	npm shrinkwrap


lint:
	find lib          -name '*.js' | xargs -n 1 $(LINT) --node --
	find instance-app -name '*.js' | xargs -n 1 $(LINT) --node --
	find hosting-app  -name '*.js' | xargs -n 1 $(LINT) --node --
	find public/js    -name '*.js' | xargs -n 1 $(LINT) --browser --


scss:
	compass compile

minify:
	rm -rf public-minified
	node_modules/.bin/r.js -o public/js/app.build.js
	rm    public-minified/build.txt
	rm    public-minified/js/app.build.js 
	rm -r public-minified/sass/


tidy:
	# this should tidy, but not implemented yet
	# The output is not as nice as I'd like
	# sass-convert --recursive --in-place --from scss --to scss public/sass/


test: npm-install test-unit test-api test-browser

test-unit:
	@NODE_ENV=testing ./node_modules/.bin/nodeunit \
		--reporter $(REPORTER) \
		tests/unit


test-browser: scss minify
	$(START_TEST_SERVER)
	@NODE_ENV=testing ruby tests/browser_based/run_tests.rb
	$(STOP_TEST_SERVER)
	echo "ALL TESTS PASSED"


test-api:
	@NODE_ENV=testing ./node_modules/.bin/nodeunit \
		--reporter $(REPORTER) \
		tests/api

clean:
	rm -rfv .sass-cache


.PHONY: test test-unit test-browser test-api scss minify clean tidy npm-install npm-update


{'fraction_non_alphanumeric': 0.12530578961674368, 'fraction_numerical': 0.0032617559119325905, 'mean_word_length': 3.111731843575419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5839120', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1327, 'n_words': 388}