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.4KB

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