]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/autotest.at (Empty test suite): New test.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Feb 2005 07:34:54 +0000 (07:34 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Feb 2005 07:34:54 +0000 (07:34 +0000)
* tests/torture.at (Substitute and define special characters)
(Substitute a 2000-byte string, Define to a 2000-byte string)
(Substitute a newline, Define a newline): New tests.

tests/autotest.at
tests/torture.at

index 4e4c52c89e811efb4d9a09fa00ff1262a78a2f3a..4a8a5e1280f6dad1ee235cbe685057b19afbf120 100644 (file)
@@ -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.  ##
 ## ----------------------------------------------------- ##
index 9f06305aa0d42ffb0153a946d18dbe0ca7710c00..512c0267751b6a7d15a3ba29872d52971749a171 100644 (file)
@@ -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,128 @@ AT_DATA([expout],
 AT_CLEANUP
 
 
+## ------------------------------- ##
+## Substitute a 2000-byte string.  ##
+## ------------------------------- ##
+
+# Solaris 9 /usr/ucb/sed that rejects commands longer than 4000 bytes.  HP/UX
+# sed dumps core around 8 KiB.  However, POSIX says that sed need not
+# handle lines longer than 2048 bytes (including the trailing newline).
+# So we'll just test a 2000-byte value.
+
+AT_SETUP([Substitute a 2000-byte string])
+
+AT_DATA([Foo.in], [@foo@
+])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_AUX_DIR($top_srcdir/config)
+AC_SUBST([foo], ]m4_for([n], 1, 100,, ....................)[)
+AC_CONFIG_FILES([Foo])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+AT_CHECK([cat Foo], 0, m4_for([n], 1, 100,, ....................)
+)
+AT_CLEANUP
+
+
+## ------------------------------ ##
+## Define to a 2000-byte string.  ##
+## ------------------------------ ##
+
+AT_SETUP([Define to a 2000-byte string])
+
+AT_CONFIGURE_AC(
+[[
+AC_DEFINE([foo], ]m4_for([n], 1, 100,, ....................)[, [desc])
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_AUTOHEADER
+AT_CHECK_CONFIGURE
+AT_CHECK_DEFINES([@%:@define foo m4_for([n], 1, 100,, ....................)
+])
+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], [@foo@
+])
+
+AT_CONFIGURE_AC(
+[[foo="AS@&t@_ESCAPE([[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],
+[@foo@
+])
+
+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.  ##
 ## -------- ##