The following commit has been merged in the master branch:
commit 939778ab9b4147d42b7250fdb1be9c5fe79392b7
Author: Guillem Jover <[email protected]>
Date:   Sat Jul 10 13:21:02 2010 +0200

    build: Refactor perl test-suite support into a new Makecheck.am file

diff --git a/Makecheck.am b/Makecheck.am
new file mode 100644
index 0000000..b88c1ea
--- /dev/null
+++ b/Makecheck.am
@@ -0,0 +1,21 @@
+# vim:set syn=automake:
+
+# Variables to be defined:
+#
+#  TEST_VERBOSE - set to 0 or 1 to control test suite verbosity
+#  TEST_ENV_VARS - environment variables to be set for the test suite
+#  test_tmpdir - test suite temporary directory
+#  test_cases - list of test case files
+#  test_data - list of test data files
+
+check-clean:
+       rm -fr $(test_tmpdir)
+
+check-local: $(test_data) $(test_cases)
+       $(mkdir_p) $(test_tmpdir)
+       
PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(top_builddir)/utils:$(PATH)"
 \
+         srcdir=$(srcdir) builddir=$(builddir) \
+         PERL5LIB=$(top_srcdir)/scripts PERL_DL_NONLAZY=1 \
+         $(PERL) -I$(top_srcdir)/scripts \
+           -MExtUtils::Command::MM -e "test_harness($(TEST_VERBOSE), '.')" \
+           $(addprefix $(srcdir)/,$(test_cases))
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 4fa25d3..bd8d40f 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -160,6 +160,9 @@ if BUILD_POD_DOC
 endif
 
 TEST_VERBOSE= 0
+TEST_ENV_VARS = \
+       DPKG_DATADIR=$(srcdir)/.. \
+       DPKG_ORIGINS_DIR=$(srcdir)/t/origins
 
 test_tmpdir = t.tmp
 
@@ -225,20 +228,6 @@ test_data = \
        t/origins/default \
        t/origins/ubuntu
 
-clean-local:
-       rm -fr man
-       rm -fr $(test_tmpdir)
-
-check-local: $(test_data) $(test_cases)
-       $(mkdir_p) $(test_tmpdir)
-       PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(PATH)" \
-         srcdir=$(srcdir) DPKG_DATADIR=$(srcdir)/.. \
-         DPKG_ORIGINS_DIR=$(srcdir)/t/origins \
-         PERL5LIB=$(srcdir) PERL_DL_NONLAZY=1 \
-         $(PERL) -I$(srcdir) -MExtUtils::Command::MM \
-                 -e "test_harness($(TEST_VERBOSE), '.')" \
-                 $(addprefix $(srcdir)/,$(test_cases))
-
 objdump_lib_name = lib`basename $...@`.so
 $(test_tmpdir)/200_Dpkg_Shlibs/objdump.basictags-amd64 
$(test_tmpdir)/200_Dpkg_Shlibs/objdump.basictags-i386: 
$(srcdir)/t/200_Dpkg_Shlibs/basictags.c
        $(mkdir_p) $(test_tmpdir)/200_Dpkg_Shlibs
@@ -256,3 +245,8 @@ $(test_tmpdir)/200_Dpkg_Shlibs/objdump.patterns: 
$(srcdir)/t/200_Dpkg_Shlibs/pat
        objdump -w -f -p -T -R $(objdump_lib_name) | \
          sed "s/$(objdump_lib_name)/libpatterns.so.1/g" > $@
        rm -f $(objdump_lib_name)
+
+include $(top_srcdir)/Makecheck.am
+
+clean-local: check-clean
+       rm -fr man
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 9e66119..403ac3a 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -66,18 +66,12 @@ if WITH_INSTALL_INFO
 endif
 
 TEST_VERBOSE = 0
+TEST_ENV_VARS = DPKG_DATADIR=$(top_srcdir)
+
 test_tmpdir = t.tmp
 test_cases = \
        t/100_update_alternatives.t
 
-clean-local:
-       rm -fr $(test_tmpdir)
-
-check-local: $(test_cases)
-       $(mkdir_p) $(test_tmpdir)
-       
PATH="$(top_builddir)/src:$(top_builddir)/scripts:$(top_builddir)/utils:$(PATH)"
 \
-         srcdir=$(srcdir) builddir=$(builddir) DPKG_DATADIR=$(top_srcdir) \
-         PERL5LIB=$(top_srcdir)/scripts \
-         $(PERL) -MExtUtils::Command::MM \
-                 -e "test_harness($(TEST_VERBOSE), '.')" \
-                 $(addprefix $(srcdir)/,$(test_cases))
+include $(top_srcdir)/Makecheck.am
+
+clean-local: check-clean

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to