File: Makefile

package info (click to toggle)
pdf2docx 0.5.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,632 kB
  • sloc: python: 6,692; makefile: 68
file content (38 lines) | stat: -rw-r--r-- 867 bytes parent folder | download
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
# makefile for testing module
# SOURCEDIR is set in top makefile
CURDIR		:=$(shell pwd)
OUTPUTDIR	:=$(CURDIR)/outputs

.PHONY: test pdf2docx docx2pdf check clean

# test: clean pdf2docx docx2pdf check
test: clean pdf2docx


pdf2docx: 
	@if [ -n "$(TESTCASE)" ] ; then \
		pytest -v test.py::TestConversion::$(TESTCASE) --cov="$(SOURCEDIR)" --cov-report=xml ; \
	else \
		pytest -v test.py::TestConversion --cov="$(SOURCEDIR)" --cov-report=xml ; \
	fi


docx2pdf:
	@if [ -n "$(wildcard outputs/*.docx)" ] ; then \
		cd $(OUTPUTDIR) ; \
		for f in *.docx ; \
		do \
			echo "Converting $$f to pdf..." ; \
			OfficeToPDF $$f ; \
		done ; \
	fi


check:
	@pytest -sv test.py::TestQuality


clean:
	@if [ -d "$(OUTPUTDIR)" ];  then rm -rf "$(OUTPUTDIR)" ; fi
	@if [ -e ".coverage" ];  then rm -f ".coverage" ; fi
	@if [ -e "coverage.xml" ];  then rm -f "coverage.xml" ; fi