Python Library Unittest
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

Makefile 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. COV3_CMD=venv3/bin/coverage
  2. PYT3_CMD=venv3/bin/python
  3. PDF_CMD=xdg-open
  4. OUTDIR=testresults
  5. TEXFILE=$(OUTDIR)/unittest.tex
  6. PDFFILE=$(OUTDIR)/unittest.pdf
  7. .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
  8. all: full
  9. help:
  10. @echo "make [target]"
  11. @echo " Here is a list of the most helpfull targets:"
  12. @echo " - release: Release the testcases, creates a pdf ducument including all testcases and copy testdata to the module"
  13. @echo " ----------------------------------------------------------------------------------------------------------------"
  14. @echo " - full: Create a pdf ducument including all testcases"
  15. @echo " - short: Create a pdf ducument including most testcases"
  16. @echo " - smoke: Create a pdf ducument including some testcases"
  17. @echo " - single: Create a pdf ducument including one testcases"
  18. @echo " ----------------------------------------------------------------------------------------------------------------"
  19. @echo " - testrun_full: Run all testcases"
  20. @echo " - testrun_short: Run most testcases"
  21. @echo " - testrun_smoke: Run some testcases"
  22. @echo " - testrun_single: Run one testcases"
  23. release: testrun_full coverage_analysis finalise compile publish status
  24. full: testrun_full finalise compile status
  25. short: testrun_short finalise compile status
  26. smoke: testrun_smoke finalise compile status
  27. single: testrun_single finalise compile status
  28. venv3:
  29. virtualenv -p /usr/bin/python3 venv3
  30. venv3/bin/pip install --upgrade pip
  31. venv3/bin/pip install -r requirements.txt
  32. clean: venv3
  33. @echo -e "\033[1;33mCleaning up unittest...\e[0m"
  34. @echo -e "\e[1m * Testresults from last testrun\e[0m"
  35. @ls testresults | xargs -i echo " testresults/{}"
  36. @ls testresults | xargs -i rm -f "testresults/{}"
  37. @echo -e "\e[1m * Collected coverage information\e[0m"
  38. @$(COV3_CMD) erase
  39. @rm -r venv3
  40. cleanall: clean
  41. @echo "\e[1m * Virtualenv\e[0m"
  42. @rm -rf venv3
  43. release_testcases:
  44. @$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
  45. prepare: venv3
  46. @$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
  47. testrun_full: clean prepare
  48. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
  49. testrun_short: clean prepare
  50. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
  51. testrun_smoke: clean prepare
  52. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
  53. testrun_single: clean prepare
  54. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e single
  55. coverage_analysis:
  56. @echo "\e[1m\e[93mCreating Coverage-XML-File: $(pwd)/testresults/coverage.xml\e[0m"
  57. @$(COV3_CMD) xml -o testresults/coverage.xml
  58. finalise: coverage_analysis
  59. @$(PYT3_CMD) src/unittest/scripts/unittest.py finalise
  60. compile:
  61. @latexmk -pdf -quiet -pdflatex="pdflatex -interaction=nonstopmode" -output-directory=$(OUTDIR) -use-make $(TEXFILE) > /dev/null
  62. status:
  63. @$(PYT3_CMD) src/unittest/scripts/unittest.py status
  64. publish:
  65. @$(PYT3_CMD) src/unittest/scripts/unittest.py publish
  66. view:
  67. @$(PDF_CMD) $(PDFFILE)