unittest/scripts/Makefile

87 lines
3.2 KiB
Makefile
Raw Normal View History

2021-08-01 21:49:40 +02:00
COV3_CMD=venv3/bin/coverage
PYT3_CMD=venv3/bin/python
PDF_CMD=xdg-open
OUTDIR=testresults
TEXFILE=$(OUTDIR)/unittest.tex
PDFFILE=$(OUTDIR)/unittest.pdf
2022-05-08 20:40:42 +02:00
.PHONY: all help venv3 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"
2021-03-04 18:36:23 +01:00
release: testrun_full coverage_analysis finalise compile publish status
full: testrun_full finalise compile status
short: testrun_short finalise compile status
smoke: testrun_smoke finalise compile status
single: testrun_single finalise compile status
2021-08-01 21:49:40 +02:00
venv3:
virtualenv -p /usr/bin/python3 venv3
venv3/bin/pip install --upgrade pip
venv3/bin/pip install -r requirements.txt
2022-05-08 20:40:42 +02:00
clean: venv3
@echo "\033[1;33mCleaning up unittest...\e[0m"
@echo "\e[1m * Testresults from last testrun\e[0m"
2021-03-07 23:53:22 +01:00
@ls testresults | xargs -i echo " testresults/{}"
@ls testresults | xargs -i rm -f "testresults/{}"
2022-05-08 20:40:42 +02:00
@echo "\e[1m * Collected coverage information\e[0m"
@$(COV3_CMD) erase
2021-08-01 21:49:40 +02:00
cleanall: clean
2022-05-08 20:40:42 +02:00
@echo "\e[1m * Virtualenv\e[0m"
@rm -rf venv3
2021-08-01 21:49:40 +02:00
release_testcases:
@$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
2022-05-08 20:40:42 +02:00
prepare: venv3
@$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
2021-03-04 18:36:23 +01:00
testrun_full: clean prepare
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
2021-03-04 18:36:23 +01:00
testrun_short: clean prepare
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
2021-03-04 18:36:23 +01:00
testrun_smoke: clean prepare
@$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
2021-03-04 18:36:23 +01:00
testrun_single: clean prepare
@$(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
2021-03-04 18:36:23 +01:00
finalise: coverage_analysis
@$(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)