UNPKG

1.32 kBPlain TextView Raw
1RABBITMQ_SRC_VERSION=v3.12.13
2JSON=amqp-rabbitmq-0.9.1.json
3AMQP_JSON=https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/$(RABBITMQ_SRC_VERSION)/deps/rabbitmq_codegen/$(JSON)
4
5NODEJS_VERSIONS='10.21' '11.15' '12.18' '13.14' '14.5' '15.8' '16.3.0' '18.1.0' '20.10.0'
6
7MOCHA=./node_modules/.bin/mocha
8_MOCHA=./node_modules/.bin/_mocha
9UGLIFY=./node_modules/.bin/uglifyjs
10NYC=./node_modules/.bin/nyc
11
12.PHONY: test test-all-nodejs all clean coverage
13
14all: lib/defs.js
15
16clean:
17 rm lib/defs.js bin/amqp-rabbitmq-0.9.1.json
18 rm -rf ./coverage
19
20lib/defs.js: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
21 (cd bin; node ./generate-defs.js > ../lib/defs.js)
22 $(UGLIFY) ./lib/defs.js -o ./lib/defs.js \
23 -c 'sequences=false' --comments \
24 -b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true)
25
26test: lib/defs.js
27 $(MOCHA) --check-leaks -u tdd --exit test/
28
29test-all-nodejs: lib/defs.js
30 for v in $(NODEJS_VERSIONS); \
31 do echo "-- Node version $$v --"; \
32 nave use $$v $(MOCHA) -u tdd --exit -R progress test; \
33 done
34
35coverage: $(NYC) lib/defs.js
36 $(NYC) --reporter=lcov --reporter=text $(_MOCHA) -u tdd -R progress test/
37 @echo "HTML report at file://$$(pwd)/coverage/lcov-report/index.html"
38
39bin/amqp-rabbitmq-0.9.1.json:
40 curl -L $(AMQP_JSON) > $@
41
42$(ISTANBUL):
43 npm install
44
45$(UGLIFY):
46 npm install