[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-cppi] [PATCH 07/19] build: don't recurse into tests/ when building
From: |
Jim Meyering |
Subject: |
[bug-cppi] [PATCH 07/19] build: don't recurse into tests/ when building |
Date: |
Wed, 25 Jan 2012 09:22:44 +0100 |
From: Jim Meyering <address@hidden>
* Makefile.am (SUBDIRS): Remove tests/.
* tests/local.mk: New file, derived from ...
(EXTRA_DIST): Add tests/init.sh.
(TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT; used in help-version.
* tests/Makefile.am: ... this file. Remove file.
* tests/help-version: Adjust PATH.
* configure.ac (AC_CONFIG_FILES): Remove tests/Makefile.
* tests/*: invoke test-common differently:
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
* cfg.mk (_hv_regex_strong): Customize a regexp to accommodate
this new usage, to avoid spurious failure of the
sc_cross_check_PATH_usage_in_tests syntax-check rule.
---
Makefile.am | 5 +--
cfg.mk | 2 +
configure.ac | 3 +-
tests/8-bit | 2 +-
tests/Makefile.am | 18 -----------------
tests/ansi-1 | 2 +-
tests/ansi-2 | 2 +-
tests/ansi-3 | 2 +-
tests/ansi-4 | 2 +-
tests/ansi-5 | 2 +-
tests/ansi-6 | 2 +-
tests/ansi-7 | 2 +-
tests/ansi-8 | 2 +-
tests/cxx-1 | 2 +-
tests/cxx-2 | 2 +-
tests/cxx-3 | 2 +-
tests/d1 | 2 +-
tests/d2 | 2 +-
tests/d3 | 2 +-
tests/d4 | 2 +-
tests/d5 | 2 +-
tests/e1 | 2 +-
tests/e2 | 2 +-
tests/e3 | 2 +-
tests/e4 | 2 +-
tests/e5 | 2 +-
tests/e6 | 2 +-
tests/e7 | 2 +-
tests/e8 | 2 +-
tests/e9 | 2 +-
tests/f1 | 2 +-
tests/f2 | 2 +-
tests/f3 | 2 +-
tests/f4 | 2 +-
tests/f5 | 2 +-
tests/f6 | 2 +-
tests/f7 | 2 +-
tests/f8 | 2 +-
tests/f9 | 2 +-
tests/help-version | 2 +-
tests/local.mk | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/stringify-1 | 2 +-
tests/stringify-2 | 2 +-
tests/stringify-3 | 2 +-
tests/stringify-4 | 2 +-
45 files changed, 100 insertions(+), 63 deletions(-)
delete mode 100644 tests/Makefile.am
create mode 100644 tests/local.mk
diff --git a/Makefile.am b/Makefile.am
index b18eadd..0cb7c07 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in.
AUTOMAKE_OPTIONS = subdir-objects
-SUBDIRS = po . tests
+SUBDIRS = po .
ACLOCAL_AMFLAGS = -I m4
@@ -43,5 +43,4 @@ SUFFIXES =
include lib/local.mk
include src/local.mk
include man/local.mk
-
-# FIXME include tests/local.mk
+include tests/local.mk
diff --git a/cfg.mk b/cfg.mk
index 48c0b6c..c993489 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -54,6 +54,8 @@ update-copyright-env = \
UPDATE_COPYRIGHT_USE_INTERVALS=1 \
UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
+_hv_regex_strong ?= ^ *\. "\$${top_srcdir=\.}/tests/init\.sh"
+
exclude_file_name_regexp--sc_prohibit_stat_st_blocks = ^src/system\.h$$
exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
(Makefile(\.am)?|\.mk)$$
diff --git a/configure.ac b/configure.ac
index c4efbea..e6d880c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,6 @@ AM_GNU_GETTEXT_VERSION([0.17])
AC_CONFIG_FILES(
Makefile
- po/Makefile.in
- tests/Makefile)
+ po/Makefile.in)
AC_OUTPUT
diff --git a/tests/8-bit b/tests/8-bit
index 8cae872..524bf0e 100755
--- a/tests/8-bit
+++ b/tests/8-bit
@@ -9,4 +9,4 @@ cp $t.I $t.EO
redirect_stdin=no
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index 329a24a..0000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-## Process this file with automake to produce Makefile.in -*-Makefile-*-
-TESTS = \
- help-version \
- version-check \
- d1 d2 d3 d4 d5 \
- e1 e2 e3 e4 e5 e6 e7 e8 e9 \
- f1 f2 f3 f4 f5 f7 f8 f9 \
- stringify-1 stringify-2 stringify-3 stringify-4 \
- 8-bit ansi-1 ansi-2 ansi-3 ansi-4 ansi-5 ansi-6 ansi-7 ansi-8 \
- cxx-1 cxx-2 cxx-3
-
-EXTRA_DIST = test-common init.sh $(TESTS)
-TESTS_ENVIRONMENT = \
- export srcdir=$(srcdir) \
- built_programs=cppi \
- VERSION='$(VERSION)' \
- PATH=../src$(PATH_SEPARATOR)$$PATH \
- ; 9>&2
diff --git a/tests/ansi-1 b/tests/ansi-1
index ebb9a9c..bbde9e1 100755
--- a/tests/ansi-1
+++ b/tests/ansi-1
@@ -17,4 +17,4 @@ EOF
options='-c --ansi'
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-2 b/tests/ansi-2
index b48b08f..3c6a2db 100755
--- a/tests/ansi-2
+++ b/tests/ansi-2
@@ -17,4 +17,4 @@ EOF
options='-c --ansi'
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-3 b/tests/ansi-3
index b8d658e..9f617bc 100755
--- a/tests/ansi-3
+++ b/tests/ansi-3
@@ -18,4 +18,4 @@ EOF
options='-c --ansi'
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-4 b/tests/ansi-4
index f39af6e..3de939b 100755
--- a/tests/ansi-4
+++ b/tests/ansi-4
@@ -20,4 +20,4 @@ EOF
options='-c --ansi'
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-5 b/tests/ansi-5
index 721d4b7..da24293 100755
--- a/tests/ansi-5
+++ b/tests/ansi-5
@@ -20,4 +20,4 @@ EOF
options='-c --ansi'
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-6 b/tests/ansi-6
index 40abaf8..379d269 100755
--- a/tests/ansi-6
+++ b/tests/ansi-6
@@ -18,4 +18,4 @@ EOF
options='-l --ansi'
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-7 b/tests/ansi-7
index dd1837e..cb4aff4 100755
--- a/tests/ansi-7
+++ b/tests/ansi-7
@@ -19,4 +19,4 @@ EOF
options='-c --ansi'
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/ansi-8 b/tests/ansi-8
index cdcc1f2..ad8e980 100755
--- a/tests/ansi-8
+++ b/tests/ansi-8
@@ -20,4 +20,4 @@ EOF
options='-c --ansi'
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/cxx-1 b/tests/cxx-1
index 5058a38..efb7fdf 100755
--- a/tests/cxx-1
+++ b/tests/cxx-1
@@ -17,4 +17,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/cxx-2 b/tests/cxx-2
index 86235aa..13fc8e9 100755
--- a/tests/cxx-2
+++ b/tests/cxx-2
@@ -16,4 +16,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/cxx-3 b/tests/cxx-3
index f0db343..7a72c65 100755
--- a/tests/cxx-3
+++ b/tests/cxx-3
@@ -15,4 +15,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/d1 b/tests/d1
index a6e0d4e..41d46e9 100755
--- a/tests/d1
+++ b/tests/d1
@@ -8,4 +8,4 @@ touch $t.I $t.EO $t.Ee
options=
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/d2 b/tests/d2
index fb61a99..f3f1e53 100755
--- a/tests/d2
+++ b/tests/d2
@@ -62,4 +62,4 @@ EOF
options=
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/d3 b/tests/d3
index 8fc3367..8cc10f1 100755
--- a/tests/d3
+++ b/tests/d3
@@ -38,4 +38,4 @@ EOF
options=
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/d4 b/tests/d4
index 0c0958b..2b5aae2 100755
--- a/tests/d4
+++ b/tests/d4
@@ -82,4 +82,4 @@ EOF
options=
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/d5 b/tests/d5
index e8b5be0..4eed39f 100755
--- a/tests/d5
+++ b/tests/d5
@@ -21,4 +21,4 @@ EOF
options=-c
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e1 b/tests/e1
index 3d7159a..f995f52 100755
--- a/tests/e1
+++ b/tests/e1
@@ -16,4 +16,4 @@ EOF
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e2 b/tests/e2
index 43a3ec2..e89b85a 100755
--- a/tests/e2
+++ b/tests/e2
@@ -16,4 +16,4 @@ EOF
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e3 b/tests/e3
index ed6757f..6a9bde7 100755
--- a/tests/e3
+++ b/tests/e3
@@ -16,4 +16,4 @@ EOF
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e4 b/tests/e4
index 7199f07..e740788 100755
--- a/tests/e4
+++ b/tests/e4
@@ -16,4 +16,4 @@ EOF
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e5 b/tests/e5
index 3f0fb14..0c39bd4 100755
--- a/tests/e5
+++ b/tests/e5
@@ -16,4 +16,4 @@ EOF
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e6 b/tests/e6
index a1d284f..754b55e 100755
--- a/tests/e6
+++ b/tests/e6
@@ -16,4 +16,4 @@ EOF
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e7 b/tests/e7
index f4e5f41..c4a1d1f 100755
--- a/tests/e7
+++ b/tests/e7
@@ -19,4 +19,4 @@ EOF
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e8 b/tests/e8
index f1da4ab..73c1d87 100755
--- a/tests/e8
+++ b/tests/e8
@@ -22,4 +22,4 @@ EOF
options=-c
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/e9 b/tests/e9
index a3259cf..428f06c 100755
--- a/tests/e9
+++ b/tests/e9
@@ -17,4 +17,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f1 b/tests/f1
index 66d458b..0d8180d 100755
--- a/tests/f1
+++ b/tests/f1
@@ -23,4 +23,4 @@ EOF
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f2 b/tests/f2
index 9c18f01..cc2c357 100755
--- a/tests/f2
+++ b/tests/f2
@@ -22,4 +22,4 @@ EOF
options=
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f3 b/tests/f3
index 3d303ec..3867c49 100755
--- a/tests/f3
+++ b/tests/f3
@@ -18,4 +18,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f4 b/tests/f4
index 3e7e036..e88ac16 100755
--- a/tests/f4
+++ b/tests/f4
@@ -19,4 +19,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f5 b/tests/f5
index 057f54a..b68ec64 100755
--- a/tests/f5
+++ b/tests/f5
@@ -32,4 +32,4 @@ EOF
options=
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f6 b/tests/f6
index 9c4adce..6c55c9f 100755
--- a/tests/f6
+++ b/tests/f6
@@ -16,4 +16,4 @@ redirect_stdin=no
options='-C dir'
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f7 b/tests/f7
index dc85d26..0fc7d55 100755
--- a/tests/f7
+++ b/tests/f7
@@ -27,4 +27,4 @@ redirect_stdin=no
options="-l $t.I2"
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f8 b/tests/f8
index 08ea0c4..4d94a72 100755
--- a/tests/f8
+++ b/tests/f8
@@ -19,4 +19,4 @@ redirect_stdin=no
options="-c"
expected_status=1
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/f9 b/tests/f9
index 92238bf..99c6ff1 100755
--- a/tests/f9
+++ b/tests/f9
@@ -23,4 +23,4 @@ EOF
options=-c
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/help-version b/tests/help-version
index c89d118..5be8a0a 100755
--- a/tests/help-version
+++ b/tests/help-version
@@ -23,7 +23,7 @@
test "x$SHELL" = x && SHELL=/bin/sh
export SHELL
-. "${srcdir=.}/init.sh"; path_prepend_ ../src
+. "${top_srcdir=.}/tests/init.sh"; path_prepend_ src
expected_failure_status_chroot=125
expected_failure_status_env=125
diff --git a/tests/local.mk b/tests/local.mk
new file mode 100644
index 0000000..1674b9c
--- /dev/null
+++ b/tests/local.mk
@@ -0,0 +1,55 @@
+
+TESTS = \
+ tests/help-version \
+ tests/version-check \
+ tests/d1 \
+ tests/d2 \
+ tests/d3 \
+ tests/d4 \
+ tests/d5 \
+ tests/e1 \
+ tests/e2 \
+ tests/e3 \
+ tests/e4 \
+ tests/e5 \
+ tests/e6 \
+ tests/e7 \
+ tests/e8 \
+ tests/e9 \
+ tests/f1 \
+ tests/f2 \
+ tests/f3 \
+ tests/f4 \
+ tests/f5 \
+ tests/f7 \
+ tests/f8 \
+ tests/f9 \
+ tests/stringify-1 \
+ tests/stringify-2 \
+ tests/stringify-3 \
+ tests/stringify-4 \
+ tests/8-bit \
+ tests/ansi-1 \
+ tests/ansi-2 \
+ tests/ansi-3 \
+ tests/ansi-4 \
+ tests/ansi-5 \
+ tests/ansi-6 \
+ tests/ansi-7 \
+ tests/ansi-8 \
+ tests/cxx-1 \
+ tests/cxx-2 \
+ tests/cxx-3
+
+$(TEST_LOGS): $(bin_PROGRAMS)
+
+EXTRA_DIST += tests/test-common tests/init.sh $(TESTS)
+TESTS_ENVIRONMENT = \
+ export \
+ srcdir=$(srcdir) \
+ top_srcdir=$(top_srcdir) \
+ built_programs="`basename $(bin_PROGRAMS)`" \
+ VERSION='$(VERSION)' \
+ PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)' \
+ PATH=src$(PATH_SEPARATOR)$$PATH \
+ ; 9>&2
diff --git a/tests/stringify-1 b/tests/stringify-1
index e672513..7352d4d 100755
--- a/tests/stringify-1
+++ b/tests/stringify-1
@@ -21,4 +21,4 @@ EOF
redirect_stdin=no
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/stringify-2 b/tests/stringify-2
index 7d06840..6e414de 100755
--- a/tests/stringify-2
+++ b/tests/stringify-2
@@ -21,4 +21,4 @@ redirect_stdin=no
options="-c"
expected_status=2
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/stringify-3 b/tests/stringify-3
index 4709384..33569ed 100755
--- a/tests/stringify-3
+++ b/tests/stringify-3
@@ -17,4 +17,4 @@ redirect_stdin=no
options="-c"
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
diff --git a/tests/stringify-4 b/tests/stringify-4
index 721e9f2..177464e 100755
--- a/tests/stringify-4
+++ b/tests/stringify-4
@@ -18,4 +18,4 @@ redirect_stdin=no
options="-c"
expected_status=0
-. $srcdir/test-common
+. $top_srcdir/tests/test-common
--
1.7.9.rc2.2.g183d6
- [bug-cppi] use mostly-non-recursive make, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 01/19] build: remove use of vestigial rm_subst, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 04/19] maint: man: use dist_man1_MANS, rather than dist_man_MANS, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 02/19] update bootstrap; don't recurse into lib/ or src/, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 08/19] maint: .gitignore: ignore/adjust a few more, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 03/19] maint: remove useless artifacts copied from coreutils, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 09/19] build: remove obsolete settings from cfg.mk, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 10/19] maint: update init.sh from gnulib, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 11/19] maint: remove redundant build output, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 05/19] build: don't recurse into man/ when building, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 07/19] build: don't recurse into tests/ when building,
Jim Meyering <=
- [bug-cppi] [PATCH 12/19] maint: use gnulib's getopt-gnu, not the deprecated getopt module, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 13/19] maint: tweak m4 quoting in AC_CONFIG_FILES, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 06/19] tests: add the help-version test, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 14/19] build: part two of using subdir-objects: handle e.g., GETOPT_H, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 17/19] version 1.16, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 18/19] maint: post-release administrivia, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 15/19] build: don't depend on help2man when building from dist tarball, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 16/19] doc: NEWS: mention our non-recursive make scheme, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 19/19] build: don't require /usr/bin/perl, Jim Meyering, 2012/01/25