Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # $OpenBSD: Makefile,v 1.6 2016/11/06 14:59:28 zhuk Exp $
  2. # To add a test named ${testname}:
  3. # 1) Create test port directory with ${testname} name.
  4. # 2) Create the ${testname}.sample containing the desired result
  5. # after bumping the test Makefile.
  6. # 3) Add the test to REGRESS_TARGETS.
  7. # user-customizeable
  8. REGRESS_TARGETS ?= t1 t2 t3 t4 t5 t6 t7 t8 t9
  9. PORTBUMP ?= ${PORTSDIR}/infrastructure/bin/portbump
  10. PORTBUMP_ARGS ?=
  11. DIFF ?= diff -u
  12. # test-specific parameters
  13. TEST_t2_ARGS = ,-main -fpm
  14. TEST_t4_ARGS = -d
  15. TEST_t5_ARGS = -W qwe
  16. TEST_t6_ARGS = -l
  17. TEST_t7_ARGS = -l
  18. # define tests
  19. .for _t in ${REGRESS_TARGETS}
  20. TEST_${_t}_DIR = ${.CURDIR}/${_t}
  21. TEST_${_t}_SAMPLE = ${.CURDIR}/${_t}.sample
  22. TEST_${_t}_RESULT = ${.OBJDIR}/${_t}.result
  23. TEST_${_t}_ARGS ?=
  24. CLEANFILES += ${TEST_${_t}_RESULT}
  25. ${_t}:
  26. @echo '=> ${_t}'
  27. .if ${TEST_${_t}_ARGS:M-l}
  28. cd ${TEST_${_t}_DIR}; make fake
  29. .endif
  30. cd ${TEST_${_t}_DIR}; ${PORTBUMP} -o ${TEST_${_t}_RESULT} ${TEST_${_t}_ARGS}
  31. @${DIFF} ${TEST_${_t}_SAMPLE} ${TEST_${_t}_RESULT}
  32. .PHONY: ${_t}
  33. .endfor
  34. .include <bsd.regress.mk>