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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. @echo "\033[1;33mCleaning up...\e[0m"
  32. @echo "\e[1m * Testresults from last testrunx\e[0m"
  33. @ls testresults | xargs -i echo " testresults/{}"
  34. @ls testresults | xargs -i rm -f "testresults/{}"
  35. @echo "\e[1m * Collected coverage information\e[0m"
  36. @$(COV3_CMD) erase
  37. release_testcases:
  38. @$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
  39. prepare:
  40. @$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
  41. testrun_full: clean prepare
  42. @$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
  43. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e full
  44. testrun_short: clean prepare
  45. @$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
  46. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e short
  47. testrun_smoke: clean prepare
  48. @$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
  49. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e smoke
  50. testrun_single: clean prepare
  51. @$(COV2_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e single
  52. @$(COV3_CMD) run -a --branch --source=`$(PYT3_CMD) src/config.py -p` src/unittest/scripts/unittest.py testrun -e single
  53. coverage_analysis:
  54. @echo "\e[1m\e[93mCreating Coverage-XML-File: $(pwd)/testresults/coverage.xml\e[0m"
  55. @$(COV3_CMD) xml -o testresults/coverage.xml
  56. finalise: coverage_analysis
  57. @$(PYT3_CMD) src/unittest/scripts/unittest.py finalise
  58. compile:
  59. @latexmk -pdf -quiet -pdflatex="pdflatex -interaction=nonstopmode" -output-directory=$(OUTDIR) -use-make $(TEXFILE) > /dev/null
  60. status:
  61. @$(PYT3_CMD) src/unittest/scripts/unittest.py status
  62. publish:
  63. @$(PYT3_CMD) src/unittest/scripts/unittest.py publish
  64. view:
  65. @$(PDF_CMD) $(PDFFILE)