initialize automake variables EXTRA_DIST and TEST_PROGS for unconditional

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.


svn path=/trunk/; revision=5914
This commit is contained in:
21:06:47 Tim Janik 2007-11-21 20:09:46 +00:00 committed by Tim Janik
parent 49568d5f16
commit 1e55738f31
25 changed files with 144 additions and 33 deletions

View File

@ -1,3 +1,36 @@
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.

View File

@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.7
@ -9,7 +10,7 @@ bin_SCRIPTS = glib-gettextize
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 \

56
Makefile.decl Normal file
View File

@ -0,0 +1,56 @@
# 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

View File

@ -366,6 +366,10 @@ if test "x$PERL_PATH" = x ; then
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 ***********************

View File

@ -1,8 +1,9 @@
## 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 \

View File

@ -1 +1,3 @@
include $(top_srcdir)/Makefile.decl
SUBDIRS = glib gobject

View File

@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
AUTOMAKE_OPTIONS = 1.6
# The name of the module.

View File

@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
# The name of the module.
DOC_MODULE=gobject

View File

@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
if HAVE_GOOD_PRINTF
else
@ -52,7 +53,7 @@ MIRRORING_TAB_SOURCE = \
# 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 \

View File

@ -1,4 +1,5 @@
## 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

View File

@ -65,8 +65,8 @@ static const char*
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;
}

View File

@ -83,13 +83,14 @@ static char *test_trap_last_stderr = NULL;
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*
@ -376,8 +377,8 @@ g_test_init (int *argc,
/* 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 */
@ -1009,7 +1010,7 @@ int
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)

View File

@ -67,6 +67,7 @@ void g_test_init (int *argc,
...);
/* 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)
@ -180,12 +181,13 @@ void g_test_add_vtable (const char *testpath,
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 {

View File

@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
INCLUDES = \
-DLIBDIR=\"$(libdir)\" -I$(top_srcdir)
@ -9,7 +10,7 @@ libcharset_la_SOURCES = \
libcharset.h \
localcharset.c
EXTRA_DIST = \
EXTRA_DIST += \
README \
config.charset \
ref-add.sin \

View File

@ -1,3 +1,5 @@
include $(top_srcdir)/Makefile.decl
INCLUDES = \
-DG_LOG_DOMAIN=\"GLib-GRegex\" \
-DSUPPORT_UCP \
@ -58,7 +60,7 @@ libpcre_la_LIBADD = $(DEP_LIBS)
libpcre_la_LDFLAGS = -no-undefined
EXTRA_DIST = \
EXTRA_DIST += \
COPYING \
makefile.msc

View File

@ -1,8 +1,7 @@
include $(top_srcdir)/Makefile.decl
INCLUDES = -g -I$(top_srcdir) -I$(top_srcdir)/glib $(GLIB_DEBUG_FLAGS)
GTESTER = $(top_builddir)/glib/gtester
TEST_PROGS =
noinst_PROGRAMS = $(TEST_PROGS)
progs_ldadd = $(top_builddir)/glib/libglib-2.0.la
@ -11,15 +10,6 @@ TEST_PROGS += testing
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

View File

@ -174,10 +174,12 @@ main (int argc,
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();
}

View File

@ -1,4 +1,6 @@
EXTRA_DIST = \
include $(top_srcdir)/Makefile.decl
EXTRA_DIST += \
update.sh \
Makefile.am-1 \
Makefile.am-2 \

View File

@ -1,9 +1,10 @@
## 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 \

View File

@ -2,6 +2,7 @@
# 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\" \
@ -142,7 +143,7 @@ gobject_extra_sources = \
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 \

View File

@ -1,10 +1,11 @@
## 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 \

View File

@ -1,7 +1,8 @@
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)

View File

@ -1,3 +1,5 @@
include $(top_srcdir)/Makefile.decl
SUBDIRS=gobject refcount
if ENABLE_REGEX
@ -31,7 +33,7 @@ spawn_test_win32_gui_LDFLAGS = -mwindows
endif
EXTRA_DIST = \
EXTRA_DIST += \
$(test_scripts) \
makefile.msc.in \
casefold.txt \

View File

@ -1,3 +1,5 @@
include $(top_srcdir)/Makefile.decl
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/glib \
@ -70,7 +72,7 @@ TESTS_ENVIRONMENT = srcdir=$(srcdir) \
########################################################################
EXTRA_DIST = \
EXTRA_DIST += \
testmarshal.list
BUILT_EXTRA_DIST = \

View File

@ -1,3 +1,5 @@
include $(top_srcdir)/Makefile.decl
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/glib \