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.

59 lines
1.7KB

  1. include @builddir@/mk/defs.mk
  2. DIRS= external compat libpkg/repo libpkg src docs scripts @testsdir@
  3. include $(MK)/dir.mk
  4. @if coverage == "1"
  5. check: clean-profiles
  6. clean-profiles:
  7. rm -f /tmp/pkg.*.profraw
  8. @endif
  9. check: all
  10. @if testsdir == "tests"
  11. export LLVM_PROFILE_FILE=/tmp/pkg.%p.profraw
  12. if [ "$(HTML)" != "" ]; then \
  13. args="-r $(top_builddir)/res.db" ; \
  14. fi ; \
  15. kyua --config=none test $$args \
  16. --kyuafile='$(top_builddir)/Kyuafile' \
  17. --build-root='$(top_builddir)' || FAILED=1 ; \
  18. if [ "$(HTML)" != "" ]; then \
  19. kyua report-html --force $$args --output=$(HTML) ; \
  20. rm -f $(top_builddir)/res.db ; \
  21. fi ; \
  22. exit $${FAILED}
  23. @endif
  24. @if coverage == "1"
  25. check-coverage: check
  26. llvm-profdata merge --output=pkg.profdata /tmp/pkg.*.profraw
  27. report-coverage:
  28. llvm-cov report ./src/pkg -instr-profile=pkg.profdata --use-color -ignore-filename-regex=external -ignore-filename-regex=compat
  29. @endif
  30. COCCI_ARGS= -I ${top_srcdir} \
  31. -I /usr/include \
  32. -I /usr/local/include \
  33. -I ${top_srcdir}/compat \
  34. -I ${top_srcdir}/libpkg \
  35. -I ${top_srcdir}/src \
  36. -I ${top_srcdir}/external/yxml \
  37. -I ${top_srcdir}/external/libucl/include \
  38. -I ${top_srcdir}/external/uthash \
  39. -I ${top_srcdir}/external/sqlite \
  40. -I ${top_srcdir}/external/libelf
  41. 1cocci:
  42. spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/libpkg ; \
  43. spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/src ;
  44. cocci:
  45. for c in ${top_srcdir}/tests/cocci/*.cocci ; do \
  46. echo "Passing $$c" ; \
  47. spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/libpkg ; \
  48. spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/src ; \
  49. done