autoconf-patches
[Top][All Lists]
Advanced

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

Autoconf testsuite and cross setups


From: Ralf Wildenhues
Subject: Autoconf testsuite and cross setups
Date: Tue, 3 Apr 2007 01:12:52 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Let's give developers with uncommon cross setups help for Autoconf
regression testing: The Autoconf testsuite should work as well as
possible with a cross-compilation environment, just like the CVS
Libtool one does.  Likewise TODO for Automake.

The patch below is a first step.  It allows

$ configure_options="--host=i586-mingw32msvc --build=i686-pc-linux-gnu" \
    make check "TESTSUITEFLAGS=FC=no F77=no"

to pass or skip most tests, on my Debian testing system.  I haven't
yet done the mktests-generated tests that fail with this:

201: AC_TRY_RUN (acgeneral.at:32)
288: AC_FUNC_SETPGRP (acfunctions.at:31)

these need to be rewritten manually, and then exempted from mktests.
And then we need documentation for $configure_options -- does anyone
see a nice way to pass variables with spaces through TESTSUITEFLAGS?

(Also, --build, and the $FC and $F77 settings should not be needed
IMHO, but let's defer the more difficult but also more cosmetic
issues for now.)

FYI, these tests are skipped:
115: AC_RUN_IFELSE (compile.at:141)
145: GNU Fortran 77 (fortran.at:33)
146: GNU Fortran (fortran.at:61)
147: AC_F77_MAIN (acfortran.at:12)
148: AC_F77_WRAPPERS (acfortran.at:13)
149: AC_FC_MAIN (acfortran.at:14)
150: AC_FC_WRAPPERS (acfortran.at:15)
151: AC_PROG_F77_C_O (acfortran.at:16)
152: AC_PROG_FC_C_O (acfortran.at:17)
155: AC_CHECK_LIB (semantics.at:35)
175: AC_CHECK_FILES (semantics.at:374)
180: AC_SYS_RESTARTABLE_SYSCALLS (semantics.at:578)

OK to apply?  Where should I write documentation beside NEWS?  HACKING
only would seem a bit thin, no?

Cheers,
Ralf

2007-04-03  Ralf Wildenhues  <address@hidden>

        * tests/base.at: Use $configure_options for configure
        invocations.
        * tests/local.at (AT_CHECK_CONFIGURE): Likewise.
        * tests/torture.at: Likewise.
        * tests/compile.at (AC_RUN_IFELSE): Skip if cross-compiling.
        * tests/semantics.at (AC_CHECK_FILES)
        (AC_SYS_RESTARTABLE_SYSCALLS): Likewise.

Index: tests/base.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/base.at,v
retrieving revision 1.41
diff -u -r1.41 base.at
--- tests/base.at       26 Oct 2006 19:30:33 -0000      1.41
+++ tests/base.at       2 Apr 2007 22:55:31 -0000
@@ -2,7 +2,8 @@
 
 AT_BANNER([Autoconf base layer.])
 
-# Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007 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
@@ -286,8 +287,8 @@
 cat <&AS_ORIGINAL_STDIN_FD >&AS_MESSAGE_FD
 ]])
 AT_CHECK_AUTOCONF
-AT_CHECK([echo Hello | top_srcdir=$abs_top_srcdir ./configure | grep -v 
'configure: loading site script '],, [Hello
+AT_CHECK([echo Hello | top_srcdir=$abs_top_srcdir ./configure 
$configure_options | grep -v 'configure: loading site script '],, [Hello
 ])
-AT_CHECK([echo Hello | top_srcdir=$abs_top_srcdir ./configure --silent])
+AT_CHECK([echo Hello | top_srcdir=$abs_top_srcdir ./configure 
$configure_options --silent])
 
 AT_CLEANUP
Index: tests/compile.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/compile.at,v
retrieving revision 1.30
diff -u -r1.30 compile.at
--- tests/compile.at    3 Apr 2006 03:18:39 -0000       1.30
+++ tests/compile.at    2 Apr 2007 22:55:31 -0000
@@ -2,7 +2,8 @@
 
 AT_BANNER([Low level compiling/preprocessing macros.])
 
-# Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007 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
@@ -118,7 +119,8 @@
 
 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0])],
              [],
-             [AC_MSG_ERROR([saw `return 0' as a failure])])
+             [AC_MSG_ERROR([saw `return 0' as a failure])],
+             [exit 77])
 
 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 2])],
              [AC_MSG_ERROR([saw `return 2' as a success])],
Index: tests/local.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/local.at,v
retrieving revision 1.35
diff -u -r1.35 local.at
--- tests/local.at      11 Sep 2006 16:42:57 -0000      1.35
+++ tests/local.at      2 Apr 2007 22:55:31 -0000
@@ -1,7 +1,7 @@
 # M4 macros used in building Autoconf test suites.        -*- Autotest -*-
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 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
@@ -240,7 +240,7 @@
 # Using --srcdir is more expensive.
 m4_define([AT_CHECK_CONFIGURE],
 [AT_CAPTURE_FILE([config.log])[]dnl
- AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1],
+ AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $configure_options $1],
          [$2],
          m4_default([$3], [ignore]), [$4])])
 
Index: tests/semantics.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/semantics.at,v
retrieving revision 1.60
diff -u -r1.60 semantics.at
--- tests/semantics.at  1 Mar 2007 00:18:28 -0000       1.60
+++ tests/semantics.at  2 Apr 2007 22:55:31 -0000
@@ -375,6 +375,7 @@
 [touch at-exists1 at-exists2
 ac_exists2=at-exists2
 ac_missing2=at-missing2
+test "$cross_compiling" = yes && exit 77
 AC_CHECK_FILES(at-exists1 at-missing1 $ac_exists2 $ac_missing2)
 rm at-exists1 at-exists2],
 [AT_CHECK_DEFINES(
@@ -574,6 +575,9 @@
 ## ------------------------------- ##
 
 
-AT_CHECK_MACRO([AC_SYS_RESTARTABLE_SYSCALLS], , ,[-W no-obsolete])
+AT_CHECK_MACRO([AC_SYS_RESTARTABLE_SYSCALLS],
+[test "$cross_compiling" = yes && exit 77
+AC_SYS_RESTARTABLE_SYSCALLS
+], ,[-W no-obsolete])
 AT_CHECK_MACRO([AC_FUNC_SETVBUF_REVERSED], , ,[-W no-obsolete])
 AT_CHECK_MACRO([AC_FUNC_WAIT3], , ,[-W no-obsolete])
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.81
diff -u -r1.81 torture.at
--- tests/torture.at    7 Feb 2007 17:45:37 -0000       1.81
+++ tests/torture.at    2 Apr 2007 22:55:31 -0000
@@ -822,14 +822,14 @@
 AT_CHECK_AUTOCONF
 
 # In place.
-AT_CHECK([./configure], [], [ignore])
+AT_CHECK([./configure $configure_options], [], [ignore])
 
 # Relative name.
-AT_CHECK([cd at-dir && ../configure], [], [ignore])
+AT_CHECK([cd at-dir && ../configure $configure_options], [], [ignore])
 
 # Absolute name.
 at_here=`pwd`
-AT_CHECK([cd at-dir && "$at_here/configure"], [], [ignore])
+AT_CHECK([cd at-dir && "$at_here/configure" $configure_options], [], [ignore])
 
 AT_CLEANUP
 
@@ -949,7 +949,7 @@
 
 # The same, but from a builddir.
 AS_MKDIR_P([builddir])
-AT_CHECK([cd builddir && ../configure], 0, [ignore])
+AT_CHECK([cd builddir && ../configure $configure_options], 0, [ignore])
 AT_CHECK([cat builddir/inner/innermost/config], 0,
 [INNER=inner
 srcdir=../../../inner/innermost
@@ -959,7 +959,8 @@
 
 # Make sure precious variables and command line options are properly
 # passed, even when there are duplicates.
-AT_CHECK([cd builddir && ../configure --prefix /bad --prefix /good INNER=bad 
INNER=good], 0, [ignore])
+AT_CHECK([cd builddir && ../configure $configure_options --prefix /bad 
--prefix /good INNER=bad INNER=good],
+         0, [ignore])
 AT_CHECK([cat builddir/inner/innermost/config], 0,
 [INNER=good
 srcdir=../../../inner/innermost
@@ -968,7 +969,7 @@
 ])
 
 # Make sure --prefix is properly quoted
-AT_CHECK([cd builddir && ../configure --prefix "/a  b c$ 'd"], 0, [ignore])
+AT_CHECK([cd builddir && ../configure $configure_options --prefix "/a  b c$ 
'd"], 0, [ignore])
 AT_CHECK([cat builddir/inner/innermost/config], 0,
 [INNER=inner
 srcdir=../../../inner/innermost
@@ -977,7 +978,7 @@
 ])
 
 # Make sure --silent is properly passed...
-AT_CHECK([cd builddir && ../configure --silent], 0, [])
+AT_CHECK([cd builddir && ../configure $configure_options --silent], 0, [])
 # ...but not stored in config.status.
 AT_CHECK([cd builddir && ./config.status --recheck], 0, [stdout])
 AT_CHECK([grep 'creating \./config.status' stdout], 0, [ignore])
@@ -1049,7 +1050,7 @@
 
 # The same, but from a builddir.
 AS_MKDIR_P([builddir])
-AT_CHECK([cd builddir && ../configure INNERMOST=build/tsomrenni], 0, [ignore])
+AT_CHECK([cd builddir && ../configure $configure_options 
INNERMOST=build/tsomrenni], 0, [ignore])
 AT_CHECK([grep INNERMOST builddir/inner/innermost/config.h], 0,
 [[#define INNERMOST build/tsomrenni
 ]])
@@ -1094,7 +1095,7 @@
 AT_CHECK([./configure --help=recursive | grep "folks"], 0, [ignore])
 
 # Running the outer configure should trigger the inner.
-AT_CHECK([./configure], 0, [ignore])
+AT_CHECK([./configure $configure_options], 0, [ignore])
 AT_CHECK([test -f inner/myfile], 0)
 
 AT_CLEANUP




reply via email to

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