blob: 29ee7419216a2a220e924a36364cfb55ddb53cea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
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:
./node_modules/mocha/bin/mocha \
--ui tdd \
--reporter $(REPORTER) \
--growl test/helper.js \
test/webcals/sax/*_test.js \
test/webcals/templates/*_test.js \
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:
./node_modules/mocha/bin/mocha \
--ui tdd \
--reporter $(REPORTER) \
--watch \
--growl \
test/helper.js $(FILES)
.PHONY: test-server
test-server:
./node_modules/test-agent/bin/js-test-agent server --growl
|