unittest/scripts/Makefile

82 lines
3.4 KiB
Makefile

COV2_CMD=python2-coverage
COV3_CMD=python3-coverage
PYT2_CMD=python2
PYT3_CMD=python3
PDF_CMD=xdg-open
OUTDIR=testresults
TEXFILE=$(OUTDIR)/unittest.tex
PDFFILE=$(OUTDIR)/unittest.pdf
.PHONY: all help release full short smoke single testrun_full testrun_short testrun_smoke testrun_single coverage_analysis finalise status compile release_testcases publish view clean
all: full
help:
@echo "make [target]"
@echo " Here is a list of the most helpfull targets:"
@echo " - release: Release the testcases, creates a pdf ducument including all testcases and copy testdata to the module"
@echo " ----------------------------------------------------------------------------------------------------------------"
@echo " - full: Create a pdf ducument including all testcases"
@echo " - short: Create a pdf ducument including most testcases"
@echo " - smoke: Create a pdf ducument including some testcases"
@echo " - single: Create a pdf ducument including one testcases"
@echo " ----------------------------------------------------------------------------------------------------------------"
@echo " - testrun_full: Run all testcases"
@echo " - testrun_short: Run most testcases"
@echo " - testrun_smoke: Run some testcases"
@echo " - testrun_single: Run one testcases"
release: release_testcases full publish
full: clean prepare testrun_full coverage_analysis finalise compile status
short: clean prepare testrun_short coverage_analysis finalise compile status
smoke: clean prepare testrun_smoke coverage_analysis finalise compile status
single: clean prepare testrun_single coverage_analysis finalise compile status
clean:
@$(PYT3_CMD) src/unittest/scripts/unittest.py clean
@echo "\e[1m * Collected coverage information\e[0m"
@$(COV3_CMD) erase
release_testcases:
@$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
prepare:
@$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
testrun_full:
@$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
testrun_short:
@$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
testrun_smoke:
@$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
testrun_single:
@$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e single
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e single
coverage_analysis:
@echo "\e[1m\e[93mCreating Coverage-XML-File: $(pwd)/testresults/coverage.xml\e[0m"
@$(COV3_CMD) xml -o testresults/coverage.xml
finalise:
@$(PYT3_CMD) src/unittest/scripts/unittest.py finalise
compile:
@latexmk -pdf -quiet -pdflatex="pdflatex -interaction=nonstopmode" -output-directory=$(OUTDIR) -use-make $(TEXFILE) > /dev/null
status:
@$(PYT3_CMD) src/unittest/scripts/unittest.py status
publish:
@$(PYT3_CMD) src/unittest/scripts/unittest.py publish
view:
@$(PDF_CMD) $(PDFFILE)