autoconf-patches
[Top][All Lists]
Advanced

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

Add tests for unusual substitutions and defines, Autotest


From: Noah Misch
Subject: Add tests for unusual substitutions and defines, Autotest
Date: Fri, 14 Jan 2005 01:22:01 -0800
User-agent: Mutt/1.5.6i

This adds six new tests.  One shows a minor Autotest bug, and the rest concern
the bugs that Albert Chin's long substitution patch and Dan Manthey's newline
substitution patch address.

These all pass or XFAIL on GNU.  The tests that create long sed `s' commands
will fail on most systems with arbitrarily limited `sed's.  I have confirmed
that on HP/UX.

2005-01-04  Noah Misch  <address@hidden>

        * tests/autotest.at (Empty test suite): New test.
        * tests/torture.at (Substitute and define special characters)
        (Substitute a 64 KiB string, Define to a 64 KiB string)
        (Substitute a newline, Define a newline): New tests.

diff -urp -X dontdiff ac-clean/tests/autotest.at ac-misctests/tests/autotest.at
--- ac-clean/tests/autotest.at  2005-01-02 12:39:22.000000000 -0500
+++ ac-misctests/tests/autotest.at      2005-01-14 03:44:09.000000000 -0500
@@ -2,7 +2,7 @@
 
 AT_BANNER([Autotest.])
 
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005 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
@@ -68,6 +68,18 @@ AT_CLEANUP
 # Here documents for these tests contain forbidden macros.
 m4_pattern_allow([^AT_])
 
+
+## ------------------ ##
+## Empty test suite.  ##
+## ------------------ ##
+
+# This is not a sensible thing to do, but the user should not get a unhelpful
+# error message, which is what happens presently.
+AT_CHECK_AT([Empty test suite],
+[[AT_INIT([empty test suite])
+]], [:])
+
+
 ## ----------------------------------------------------- ##
 ## Newlines and command substitutions in test commands.  ##
 ## ----------------------------------------------------- ##
diff -urp -X dontdiff ac-clean/tests/torture.at ac-misctests/tests/torture.at
--- ac-clean/tests/torture.at   2005-01-02 12:39:22.000000000 -0500
+++ ac-misctests/tests/torture.at       2005-01-14 04:14:29.428705659 -0500
@@ -1,6 +1,7 @@
 #                                                      -*- Autotest -*-
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 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
@@ -475,6 +476,126 @@ AT_DATA([expout],
 AT_CLEANUP
 
 
+## ---------------------------- ##
+## Substitute a 64 KiB string.  ##
+## ---------------------------- ##
+
+# Solaris 9 /usr/ucb/sed that rejects commands longer than 4000 bytes.  HP/UX
+# sed dumps core around 8 KiB.  Let's try a 64 KiB substitution.
+
+AT_SETUP([Substitute a 64 KiB string])
+
+AT_DATA([Foo.in], address@hidden@
+])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_AUX_DIR($top_srcdir/config)
+AC_SUBST([foo], ]m4_for([n], 1, 4096,, [CCCCCCCCCCCCCCCC])[)
+AC_CONFIG_FILES([Foo])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+AT_CHECK([cat Foo], 0, m4_for([n], 1, 4096,, [CCCCCCCCCCCCCCCC])
+)
+AT_CLEANUP
+
+
+## --------------------------- ##
+## Define to a 64 KiB string.  ##
+## --------------------------- ##
+
+AT_SETUP([Define to a 64 KiB string])
+
+AT_CONFIGURE_AC(
+[[
+AC_DEFINE([foo], ]m4_for([n], 1, 4096,, [CCCCCCCCCCCCCCCC])[, [desc])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+AT_CHECK_DEFINES(address@hidden:@define foo m4_for([n], 1, 4096,, 
[CCCCCCCCCCCCCCCC])
+])
+AT_CLEANUP
+
+
+## ------------------------------------------ ##
+## Substitute and define special characters.  ##
+## ------------------------------------------ ##
+
+# Use characters special to the shell, sed, and M4.
+
+AT_SETUP([Substitute and define special characters])
+
+AT_DATA([Foo.in], address@hidden@
+])
+
+AT_CONFIGURE_AC(
+[[foo="AS@&address@hidden([[X*'[]+ ", `\($foo]])"
+AC_SUBST([foo])
+AC_DEFINE([foo], [[X*'[]+ ", `\($foo]], [Awful value.])
+AC_CONFIG_FILES([Foo])]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+AT_CHECK([cat Foo], 0, [[X*'[]+ ", `\($foo
+]])
+AT_CHECK_DEFINES([[#define foo X*'[]+ ", `\($foo
+]])
+AT_CLEANUP
+
+
+## ---------------------- ##
+## Substitute a newline.  ##
+## ---------------------- ##
+
+AT_SETUP([Substitute a newline])
+AT_XFAIL_IF(:)
+
+AT_DATA([Foo.in],
address@hidden@
+])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_AUX_DIR($top_srcdir/config)
+foo='one
+two'
+AC_SUBST([foo])
+AC_CONFIG_FILES([Foo])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+AT_CHECK([cat Foo], 0, [one
+two
+])
+AT_CLEANUP
+
+
+## ------------------ ##
+## Define a newline.  ##
+## ------------------ ##
+
+AT_SETUP([Define a newline])
+AT_XFAIL_IF(:)
+AT_CONFIGURE_AC([[AC_DEFINE([foo], [one
+two], [This spans two lines.])
+]])
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+AT_CHECK_DEFINES([[#define foo one
+two
+]])
+AT_CLEANUP
+
+
 ## -------- ##
 ## srcdir.  ##
 ## -------- ##




reply via email to

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