forked from node-webot/webot-douban-event
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (30 loc) · 972 Bytes
/
Makefile
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
LOG_FILE = ./tmp.log
nonce="19283749"
# token for test environment
token="keyboardcat123"
timestamp=$(shell date +%s)
# how can this sort happen?
str_arr=$(sort $(nonce) $(timestamp) $(token))
str=$(subst $(eval) ,,$(str_arr))
sig=`md5 -qs $(str)`
TEST_URI="http://wx.kanfa.org/?signature=$(sig)×tamp=$(timestamp)&nonce=$(nonce)"
TEST_URI_LOCAL="http://0.0.0.0:3000/?signature=$(sig)×tamp=$(timestamp)&nonce=$(nonce)"
start:
@export DEBUG="webot* weixin* -*:verbose" && forever --watch app.js
# interactive model
send: clear
@read -p '输入要发送的文字:' txt;\
xx=`cat ./test/wx_text.xml | sed s/{text}/$${txt}/`;\
curl -d "$$xx" $(TEST_URI_LOCAL)
@echo "\n"
clear:
@clear
test: clear
./node_modules/mocha/bin/mocha
@echo "\n"
cov: lib-cov
@EXPRESS_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
@-rm -rf ../ll-cov
lib-cov:
@jscoverage --exclude=.git --exclude=test --exclude=node_modules ./ ../ll-cov
.PHONY: test cov lib-cov