File: rules

package info (click to toggle)
swift-bench 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 192 kB
  • ctags: 114
  • sloc: python: 766; makefile: 27; sh: 12
file content (35 lines) | stat: -rwxr-xr-x 1,078 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

PYTHONS:=$(shell pyversions -vr)

include /usr/share/openstack-pkg-tools/pkgos.make

%:
	dh $@ --buildsystem=python_distutils --with python2

override_dh_install:
	dh_install --fail-missing
	rm -rf debian/swift-bench/usr/lib/python*/dist-packages/tests

	install -D -m 0644 $(CURDIR)/etc/swift-bench.conf-sample			$(CURDIR)/debian/swift-bench/etc/swift/swift-bench.conf

override_dh_clean:
	dh_clean
	rm -rf .testrepository

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. python setup.py testr
	@echo "===> Running tests"
	set -e ; set -x ; for i in $(PYTHONS) ; do \
		PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
		echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
		rm -rf .testrepository ; \
		testr-python$$PYMAJOR init ; \
		TEMP_REZ=`mktemp -t` ; \
		PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit | tee $$TEMP_REZ | subunit2pyunit ; \
		cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
		rm -f $$TEMP_REZ ; \
		testr-python$$PYMAJOR slowest ; \
	done
endif