+2007-11-21 21:06:47 Tim Janik <timj@imendio.com>
+
+ * Makefile.decl: initialize automake variables EXTRA_DIST and
+ TEST_PROGS for unconditional appending via += in other makefiles.
+ define recursive test targets: test, test-report, perf-report,
+ full-report, as described here:
+ http://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00000.html
+
+ * Makefile.am:
+ * build/win32/vs8/Makefile.am, build/win32/dirent/Makefile.am:
+ * build/win32/Makefile.am, build/Makefile.am:
+ * docs/Makefile.am, docs/reference/Makefile.am:
+ * docs/reference/glib/Makefile.am, docs/reference/gobject/Makefile.am:
+ * gmodule/Makefile.am, tests/Makefile.am:
+ * tests/refcount/Makefile.am, tests/gobject/Makefile.am:
+ * glib/update-pcre/Makefile.am, glib/libcharset/Makefile.am:
+ * glib/tests/Makefile.am, glib/pcre/Makefile.am:
+ * glib/gnulib/Makefile.am, gobject/Makefile.am, m4macros/Makefile.am:
+ * gthread/Makefile.am, glib/Makefile.am:
+ include $(top_srcdir)/Makefile.decl, adapted EXTRA_DIST assignments.
+
+ * glib/tests/Makefile.am: removed example testing rules.
+
+ * glib/tests/testing.c: conditionalized performance and slow tests.
+
+ * glib/gtestutils.h:
+ * glib/gtestutils.c: work around g_test_config_vars not changing its
+ exported value after value assignments, aparently due to symbol aliases.
+
+ * glib/gtester.c: fixed off-by-one error which produced junk in logs.
+
+ * configure.in: check for python >= 2.4 and provide $PYTHON for scripts.
+
Tue Nov 20 15:59:55 2007 +0100 Tim Janik
Renamed gtestframework to gtestutils.
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.7
INCLUDES = -DG_LOG_DOMAIN=g_log_domain_glib @GLIB_DEBUG_FLAGS@ \
-DG_DISABLE_DEPRECATED -DGLIB_COMPILATION
-EXTRA_DIST = \
+EXTRA_DIST += \
ChangeLog.pre-2-14 \
ChangeLog.pre-2-12 \
ChangeLog.pre-2-10 \
--- /dev/null
+# GLIB - Library of useful C routines
+
+#GTESTER = gtester # for non-GLIB packages
+GTESTER = $(top_builddir)/glib/gtester # for the GLIB package
+
+# initialize variables for unconditional += appending
+EXTRA_DIST =
+TEST_PROGS =
+
+### testing rules
+
+# test: run all tests in cwd and subdirs
+test: ${TEST_PROGS}
+ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
+ @ for subdir in $(SUBDIRS) ; do \
+ test "$$subdir" = "." -o "$$subdir" = "po" || \
+ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+ done
+# test-report: run tests in subdirs and generate report
+# perf-report: run tests in subdirs with -m perf and generate report
+# full-report: like test-report: with -m perf and -m slow
+test-report perf-report full-report: ${TEST_PROGS}
+ @test -z "${TEST_PROGS}" || { \
+ case $@ in \
+ test-report) test_options="-k";; \
+ perf-report) test_options="-k -m=perf";; \
+ full-report) test_options="-k -m=perf -m=slow";; \
+ esac ; \
+ if test -z "$$GTESTER_LOGDIR" ; then \
+ ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
+ elif test -n "${TEST_PROGS}" ; then \
+ ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
+ fi ; \
+ }
+ @ ignore_logdir=true ; \
+ if test -z "$$GTESTER_LOGDIR" ; then \
+ GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
+ ignore_logdir=false ; \
+ fi ; \
+ for subdir in $(SUBDIRS) ; do \
+ test "$$subdir" = "." -o "$$subdir" = "po" || \
+ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+ done ; \
+ $$ignore_logdir || { \
+ echo '<?xml version="1.0"?>' > $@.xml ; \
+ echo '<report-collection>' >> $@.xml ; \
+ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
+ sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
+ done ; \
+ echo >> $@.xml ; \
+ echo '</report-collection>' >> $@.xml ; \
+ rm -rf "$$GTESTER_LOGDIR"/ ; \
+ }
+.PHONY: test test-report perf-report full-report
+# run make test as part of make check
+check-local: test
fi
AC_SUBST(PERL_PATH)
+# Need suitable python path for greport
+AM_PATH_PYTHON(2.4,,PYTHON="/usr/bin/env python2.4")
+
+
dnl ***********************
dnl *** Tests for iconv ***
dnl ***********************
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
SUBDIRS = reference
-EXTRA_DIST = debugging.txt macros.txt
+EXTRA_DIST += debugging.txt macros.txt
files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
+include $(top_srcdir)/Makefile.decl
+
SUBDIRS = glib gobject
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.6
# The name of the module.
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
# The name of the module.
DOC_MODULE=gobject
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
if HAVE_GOOD_PRINTF
else
# The compilation of GRegex can be disabled, but the source files must
# be distributed.
-EXTRA_DIST = \
+EXTRA_DIST += \
makefile.msc.in \
glib.rc.in \
gen-unicode-tables.pl \
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -DG_LOG_DOMAIN=\"GLib\" \
$(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION
sindent (guint n)
{
static const char spaces[] = " ";
- int l = sizeof (spaces);
- n = MIN (n, l - 1);
+ int l = sizeof (spaces) - 1;
+ n = MIN (n, l);
return spaces + l - n;
}
static char *test_uri_base = NULL;
static gboolean test_debug_log = FALSE;
static DestroyEntry *test_destroy_queue = NULL;
-const GTestConfig *g_test_config_vars = NULL;
static GTestConfig mutable_test_config_vars = {
+ FALSE, /* test_initialized */
TRUE, /* test_quick */
FALSE, /* test_perf */
FALSE, /* test_verbose */
FALSE, /* test_quiet */
};
+const GTestConfig * const g_test_config_vars = &mutable_test_config_vars;
/* --- functions --- */
const char*
/* check caller args */
g_return_if_fail (argc != NULL);
g_return_if_fail (argv != NULL);
- g_return_if_fail (g_test_config_vars == NULL);
- g_test_config_vars = &mutable_test_config_vars;
+ g_return_if_fail (g_test_config_vars->test_initialized == FALSE);
+ mutable_test_config_vars.test_initialized = TRUE;
va_start (args, argv);
vararg1 = va_arg (args, gpointer); /* reserved for future extensions */
g_test_run_suite (GTestSuite *suite)
{
guint n_bad = 0;
- g_return_val_if_fail (g_test_config_vars != NULL, -1);
+ g_return_val_if_fail (g_test_config_vars->test_initialized, -1);
g_return_val_if_fail (g_test_run_once == TRUE, -1);
g_test_run_once = FALSE;
if (!test_paths)
...);
/* query testing framework config */
#define g_test_quick() (g_test_config_vars->test_quick)
+#define g_test_slow() (!g_test_config_vars->test_quick)
#define g_test_perf() (g_test_config_vars->test_perf)
#define g_test_verbose() (g_test_config_vars->test_verbose)
#define g_test_quiet() (g_test_config_vars->test_quiet)
void (*data_test) (void),
void (*data_teardown) (void));
typedef struct {
+ gboolean test_initialized;
gboolean test_quick; /* disable thorough tests */
gboolean test_perf; /* run performance tests */
gboolean test_verbose; /* extra info */
gboolean test_quiet; /* reduce output */
} GTestConfig;
-GLIB_VAR const GTestConfig *g_test_config_vars;
+GLIB_VAR const GTestConfig * const g_test_config_vars;
/* internal logging API */
typedef enum {
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
INCLUDES = \
-DLIBDIR=\"$(libdir)\" -I$(top_srcdir)
libcharset.h \
localcharset.c
-EXTRA_DIST = \
+EXTRA_DIST += \
README \
config.charset \
ref-add.sin \
+include $(top_srcdir)/Makefile.decl
+
INCLUDES = \
-DG_LOG_DOMAIN=\"GLib-GRegex\" \
-DSUPPORT_UCP \
libpcre_la_LDFLAGS = -no-undefined
-EXTRA_DIST = \
+EXTRA_DIST += \
COPYING \
makefile.msc
-INCLUDES = -g -I$(top_srcdir) -I$(top_srcdir)/glib $(GLIB_DEBUG_FLAGS)
+include $(top_srcdir)/Makefile.decl
-GTESTER = $(top_builddir)/glib/gtester
+INCLUDES = -g -I$(top_srcdir) -I$(top_srcdir)/glib $(GLIB_DEBUG_FLAGS)
-TEST_PROGS =
noinst_PROGRAMS = $(TEST_PROGS)
progs_ldadd = $(top_builddir)/glib/libglib-2.0.la
testing_SOURCES = testing.c
testing_LDADD = $(progs_ldadd)
-# exemplary unit test rules
-test:
- ${GTESTER} --verbose ${TEST_PROGS}
-test-report:
- ${GTESTER} --verbose -k -o testreport.xml ${TEST_PROGS}
-.PHONY: test test-report
-check-local: test
-
-
# some testing of gtester funcitonality
XMLLINT=xmllint
gtester-xmllint-check: # check testreport xml with xmllint if present
g_test_add_func ("/random-generator/rand-2", test_rand2);
g_test_add_func ("/misc/assertions", test_assertions);
g_test_add ("/misc/primetoul", Fixturetest, fixturetest_setup, fixturetest_test, fixturetest_teardown);
- g_test_add_func ("/misc/timer", test_timer);
+ if (g_test_perf())
+ g_test_add_func ("/misc/timer", test_timer);
g_test_add_func ("/forking/fail assertion", test_fork_fail);
g_test_add_func ("/forking/patterns", test_fork_patterns);
- g_test_add_func ("/forking/timeout", test_fork_timeout);
+ if (g_test_slow())
+ g_test_add_func ("/forking/timeout", test_fork_timeout);
return g_test_run();
}
-EXTRA_DIST = \
+include $(top_srcdir)/Makefile.decl
+
+EXTRA_DIST += \
update.sh \
Makefile.am-1 \
Makefile.am-2 \
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -I$(top_srcdir)/gmodule \
-DG_LOG_DOMAIN=\"GModule\" @GLIB_DEBUG_FLAGS@ -DG_DISABLE_DEPRECATED
-EXTRA_DIST = \
+EXTRA_DIST += \
makefile.msc.in \
gmoduleconf.h.in \
gmodule.def \
# Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc.
#
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
INCLUDES = \
-DG_LOG_DOMAIN=\"GLib-GObject\" \
gobject_target_headers = $(gobject_public_h_sources)
gobject_target_sources = $(gobject_c_sources)
EXTRA_HEADERS =
-EXTRA_DIST = \
+EXTRA_DIST += \
$(gobject_private_h_sources) \
$(gobject_extra_sources) \
makegobjectalias.pl \
## Process this file with automake to produce Makefile.in
+include $(top_srcdir)/Makefile.decl
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -I$(top_srcdir)/gthread \
-DG_LOG_DOMAIN=\"GThread\" @GTHREAD_COMPILE_IMPL_DEFINES@ \
@GLIB_DEBUG_FLAGS@ -DG_DISABLE_DEPRECATED
-EXTRA_DIST = \
+EXTRA_DIST += \
makefile.msc.in \
gthread-posix.c \
gthread-win32.c \
+include $(top_srcdir)/Makefile.decl
installed_m4= glib-2.0.m4 glib-gettext.m4
-EXTRA_DIST=$(installed_m4)
+EXTRA_DIST+=$(installed_m4)
m4datadir = $(datadir)/aclocal
m4data_DATA = $(installed_m4)
+include $(top_srcdir)/Makefile.decl
+
SUBDIRS=gobject refcount
if ENABLE_REGEX
endif
-EXTRA_DIST = \
+EXTRA_DIST += \
$(test_scripts) \
makefile.msc.in \
casefold.txt \
+include $(top_srcdir)/Makefile.decl
+
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/glib \
########################################################################
-EXTRA_DIST = \
+EXTRA_DIST += \
testmarshal.list
BUILT_EXTRA_DIST = \
+include $(top_srcdir)/Makefile.decl
+
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/glib \