automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer aroun


From: Stefano Lattarini
Subject: Re: [BIKESHEDDING PATCH] Generated tests are now just a thin layer around other tests.
Date: Sun, 23 May 2010 17:51:15 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; )

Here it is my attempt to a patch.

Regards,
   Stefano
From 9f43423626ad1c68ee0ba8451fe809f70be3f223 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sun, 23 May 2010 17:44:36 +0200
Subject: [PATCH] Fix distcheck failure with distributed generated parallel 
tests.

* tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
being different from the value at developer `make dist' time.
* tests/defs.in: Protect against mutiple inclusion, by creating
a dummy `./defs' file in the test directory.
($srcdir): Do not compute, but simply define to address@hidden@'
as substituted bu configure.
Prepend a couple of error messages with the name of the running
test script.

Report and first fix by Ralf Wildenhues, final patch by Stefano
Lattarini.
---
 ChangeLog         |   15 +++++++++++++++
 tests/Makefile.am |    3 ++-
 tests/Makefile.in |    3 ++-
 tests/defs.in     |   20 ++++++++++----------
 4 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 71b0d9b..48a0e76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-05-23  Stefano Lattarini  <address@hidden>
+           Ralf Wildenhues  <address@hidden>
+
+       Fix distcheck failure with distributed generated parallel tests.
+       * tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
+       being different from the value at developer `make dist' time.
+       * tests/defs.in: Protect against mutiple inclusion, by creating
+       a dummy `./defs' file in the test directory.
+       ($srcdir): Do not compute, but simply define to address@hidden@'
+       as substituted bu configure.
+       Prepend a couple of error messages with the name of the running
+       test script.
+       Report and first fix by Ralf Wildenhues, final patch by Stefano
+       Lattarini.
+
 2010-04-25  Ralf Wildenhues  <address@hidden>
 
        Warning and error message formatting cleanups.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cff34c5..1c150de 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,7 +34,8 @@ $(parallel_tests): Makefile.am
        { echo '#!/bin/sh'; \
          echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
          echo 'parallel_tests=yes'; \
-         echo ". '$(srcdir)/$$input'"; \
+         echo '. ./defs || Exit 1'; \
+         echo ". \"\$$testsrcdir/$$input\""; \
        } > address@hidden
        $(AM_V_at)chmod a+rx address@hidden && mv -f address@hidden $@
 
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3ff9012..e010240 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1386,7 +1386,8 @@ $(parallel_tests): Makefile.am
        { echo '#!/bin/sh'; \
          echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
          echo 'parallel_tests=yes'; \
-         echo ". '$(srcdir)/$$input'"; \
+         echo '. ./defs || Exit 1'; \
+         echo ". \"\$$testsrcdir/$$input\""; \
        } > address@hidden
        $(AM_V_at)chmod a+rx address@hidden && mv -f address@hidden $@
 
diff --git a/tests/defs.in b/tests/defs.in
index 497b57f..213bd90 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -2,7 +2,7 @@
 # @configure_input@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,26 +34,22 @@ else
   case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 fi
 
+me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
+
 # Ensure we are running from the right directory.
 test -f ./defs || {
-   echo "defs: not found in current directory" 1>&2
+   echo "$me: defs: not found in current directory" 1>&2
    exit 1
 }
 
-if test -z "$srcdir"; then
-   # compute $srcdir.
-   srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
-   test "$srcdir" = $0 && srcdir=.
-else :; fi
+srcdir=${srcdir-'@abs_srcdir@'}
 
 # Ensure $srcdir is set correctly.
 test -f "$srcdir/defs.in" || {
-   echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
+   echo "$me: $srcdir/defs.in not found, check \$srcdir" 1>&2
    exit 1
 }
 
-me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
-
 # Make sure we override the user shell.
 SHELL='@SHELL@'
 export SHELL
@@ -428,6 +424,10 @@ AUTOMAKE_fails ()
   AUTOMAKE_run 1 ${1+"$@"}
 }
 
+# Protect against attempted multiple inclusions of this file.
+# This might be especially useful in generated test scripts.
+echo 'echo "$me: ./defs already included"' > defs
+
 # Turn on shell traces.
 set -x
 
-- 
1.6.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]