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.
 
 
 
 
 
 

54 lines
2.1 KiB

  1. GTESTER = gtester # in $PATH for non-GLIB packages
  2. GTESTER_REPORT = gtester-report # in $PATH for non-GLIB packages
  3. # initialize variables for unconditional += appending
  4. TEST_PROGS =
  5. # test: run all tests in cwd and subdirs
  6. test: ${TEST_PROGS}
  7. @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
  8. @ for subdir in $(SUBDIRS) . ; do \
  9. test "$$subdir" = "." -o "$$subdir" = "po" || \
  10. ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
  11. done
  12. # test-report: run tests in subdirs and generate report
  13. # perf-report: run tests in subdirs with -m perf and generate report
  14. # full-report: like test-report: with -m perf and -m slow
  15. test-report perf-report full-report: ${TEST_PROGS}
  16. @test -z "${TEST_PROGS}" || { \
  17. case $@ in \
  18. test-report) test_options="-k";; \
  19. perf-report) test_options="-k -m=perf";; \
  20. full-report) test_options="-k -m=perf -m=slow";; \
  21. esac ; \
  22. if test -z "$$GTESTER_LOGDIR" ; then \
  23. ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
  24. elif test -n "${TEST_PROGS}" ; then \
  25. ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
  26. fi ; \
  27. }
  28. @ ignore_logdir=true ; \
  29. if test -z "$$GTESTER_LOGDIR" ; then \
  30. GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
  31. ignore_logdir=false ; \
  32. fi ; \
  33. for subdir in $(SUBDIRS) . ; do \
  34. test "$$subdir" = "." -o "$$subdir" = "po" || \
  35. ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
  36. done ; \
  37. $$ignore_logdir || { \
  38. echo '<?xml version="1.0"?>' > $@.xml ; \
  39. echo '<report-collection>' >> $@.xml ; \
  40. for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
  41. sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
  42. done ; \
  43. echo >> $@.xml ; \
  44. echo '</report-collection>' >> $@.xml ; \
  45. rm -rf "$$GTESTER_LOGDIR"/ ; \
  46. ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
  47. }
  48. .PHONY: test test-report perf-report full-report
  49. # run make test as part of make check
  50. check-local: test