Python Library Unittest
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. cleanall: clean
  40. @echo "\e[1m * Virtualenv\e[0m"
  41. @rm -rf venv3
  42. release_testcases:
  43. @$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
  44. prepare: venv3
  45. @$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
  46. testrun_full: clean prepare
  47. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
  48. testrun_short: clean prepare
  49. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
  50. testrun_smoke: clean prepare
  51. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
  52. testrun_single: clean prepare
  53. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e single
  54. coverage_analysis:
  55. @echo "\e[1m\e[93mCreating Coverage-XML-File: $(pwd)/testresults/coverage.xml\e[0m"
  56. @$(COV3_CMD) xml -o testresults/coverage.xml
  57. finalise: coverage_analysis
  58. @$(PYT3_CMD) src/unittest/scripts/unittest.py finalise
  59. compile:
  60. @latexmk -pdf -quiet -pdflatex="pdflatex -interaction=nonstopmode" -output-directory=$(OUTDIR) -use-make $(TEXFILE) > /dev/null
  61. status:
  62. @$(PYT3_CMD) src/unittest/scripts/unittest.py status
  63. publish:
  64. @$(PYT3_CMD) src/unittest/scripts/unittest.py publish
  65. view:
  66. @$(PDF_CMD) $(PDFFILE)