Makefile.decl
author Mikael Hallendal <micke@imendio.com>
Sun, 13 Jul 2008 00:57:14 +0200
changeset 444 57c59cfdd77c
parent 397 5e2ad0e0704a
permissions -rw-r--r--
Made the output buffer functions private to LmOldSocket.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
397
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     1
# GLIB - Library of useful C routines
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     2
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     3
GTESTER = gtester 			# for non-GLIB packages
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     4
#GTESTER = $(top_builddir)/glib/gtester			# for the GLIB package
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     5
GTESTER_REPORT = gtester-report	        # for non-GLIB package
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     6
# GTESTER_REPORT = $(top_builddir)/glib/gtester-report	# for the GLIB package
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     7
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     8
# initialize variables for unconditional += appending
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
     9
EXTRA_DIST =
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    10
TEST_PROGS =
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    11
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    12
### testing rules
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    13
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    14
# test: run all tests in cwd and subdirs
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    15
test:	${TEST_PROGS}
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    16
	@test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    17
	@ for subdir in $(SUBDIRS) . ; do \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    18
	    test "$$subdir" = "." -o "$$subdir" = "po" || \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    19
	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    20
	  done
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    21
# test-report: run tests in subdirs and generate report
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    22
# perf-report: run tests in subdirs with -m perf and generate report
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    23
# full-report: like test-report: with -m perf and -m slow
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    24
test-report perf-report full-report:	${TEST_PROGS}
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    25
	@test -z "${TEST_PROGS}" || { \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    26
	  case $@ in \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    27
	  test-report) test_options="-k";; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    28
	  perf-report) test_options="-k -m=perf";; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    29
	  full-report) test_options="-k -m=perf -m=slow";; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    30
	  esac ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    31
	  if test -z "$$GTESTER_LOGDIR" ; then	\
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    32
	    ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    33
	  elif test -n "${TEST_PROGS}" ; then \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    34
	    ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    35
	  fi ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    36
	}
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    37
	@ ignore_logdir=true ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    38
	  if test -z "$$GTESTER_LOGDIR" ; then \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    39
	    GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    40
	    ignore_logdir=false ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    41
	  fi ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    42
	  for subdir in $(SUBDIRS) . ; do \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    43
	    test "$$subdir" = "." -o "$$subdir" = "po" || \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    44
	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    45
	  done ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    46
	  $$ignore_logdir || { \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    47
	    echo '<?xml version="1.0"?>' > $@.xml ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    48
	    echo '<report-collection>'  >> $@.xml ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    49
	    for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    50
	      sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    51
	    done ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    52
	    echo >> $@.xml ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    53
	    echo '</report-collection>' >> $@.xml ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    54
	    rm -rf "$$GTESTER_LOGDIR"/ ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    55
	    ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    56
	  }
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    57
.PHONY: test test-report perf-report full-report
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    58
# run make test as part of make check
5e2ad0e0704a Migrated test suite to GLib unit test framework
Mikael Hallendal <micke@imendio.com>
parents:
diff changeset
    59
check-local: test