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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
all: doc
include links.mk
links.mk: links
awk '{ print("LINKS +=", $$1); print($$1, ":"); print("\ttest -e ", $$2); print("\tmkdir -p $$(shell dirname ", $$1, ")"); print("\tln -sf", $$2, $$1)}' $^ > $@
MANPAGES = $(patsubst bin/%, man/%.1, $(shell grep -rl =head1 bin/*))
all: $(LINKS) $(MANPAGES)
.PHONY: spec check test quick-check coverage
checkdeps:
@if which dpkg-checkbuilddeps >/dev/null && which grep-dctrl >/dev/null; then dpkg-checkbuilddeps -d "$$(grep-dctrl -n -s Depends . debian/control | grep -v '\$$')"; fi
export COVERAGE ?= no
spec:
@./test/banner 'Ruby unit tests'
rspec --color
spec-postgresql:
@./test/banner 'Ruby unit tests (PostgreSQL)'
pg_virtualenv sh -c 'DATABASE_URL=postgresql:///$$PGDATABASE rspec --color'
coverage:
$(MAKE) spec COVERAGE=yes
functional-tests:
@./test/banner 'Functional tests'
test/runall.sh
$(RM) -v test/erl_crash.dump
backends = $(shell ls -1 backends/)
test_backends = $(patsubst %, test-%, $(backends))
.PHONY: $(test_backends)
test-backends: $(test_backends)
$(test_backends): test-% : backends/%/test-package
@./test/banner "Test backend $*"
./bin/debci test -b $* test/fake-package/ > log/test-$*.log 2>&1 # local source package
./bin/debci test -b $* ruby-defaults > log/test-$*.log 2>&1 # source package from archive
deb:
mkdir -p tmp/deb
rm -rf tmp/deb/debci*
DEB_BUILD_OPTIONS=nocheck gbp buildpackage --git-ignore-branch --git-export-dir=tmp/deb
cd tmp/deb && dpkg-scanpackages . > Packages
@echo
@echo "Debian packages available in tmp/deb/!"
ruby-console:
./bin/debci shell
check: all check-ui-and-docs check-ruby-style check-shell codespell spec spec-postgresql functional-tests
check-ui-and-docs: all
test -d public/doc
test -f public/doc/index.html
test -L public/doc/js/jquery.js -a -f public/doc/js/jquery.js
test -L public/jquery.js -a -f public/jquery.js
test -L public/bootstrap
check-ruby-style:
if type rubocop; then rubocop; fi
check-shell:
./tools/check-shell-scripts.sh
codespell:
if type codespell; then codespell --ignore-words tools/codespell-ignore.txt; fi
test: check
quick-check: check-ruby-style check-shell codespell spec
doc: public/doc/index.html public/doc/architecture.svg
public/doc/index.html public/doc/jq/jquery.js: README.md $(sort $(wildcard docs/*.md)) $(shell find lib -name '*.rb' | LC_ALL=C sort)
$(RM) public/doc/js/jquery.js
yardoc --markup markdown --output-dir public/doc --main README.md lib - $^
$(RM) public/doc/frames.html
ln -sf ../../jquery.js public/doc/js/jquery.js
public/doc/architecture.svg: docs/architecture.svg public/doc
cp docs/architecture.svg public/doc/
public/doc:
mkdir -p $@
$(MANPAGES): man/%.1: bin/% man
pod2man --center "" --release "" --section=1 --utf8 $< $@
man:
mkdir $@
.PHONY: tags
tags:
ctags -R backends/ bin/ lib/ public/doc.js public/app.js public/style.css spec/ test/ tools/
clean:
$(RM) -rf $(generated) tags public/doc links.mk $(LINKS) man/
|