mirror of
git://git.sv.gnu.org/autoconf
synced 2025-01-06 10:25:53 +08:00
a8c122d0f2
* tests/atgeneral.m4 (AT_INIT): Initialize AT_banner_ordinal. Execute the epilogue of the tests only if a test was run. Don't built the value of `at_tests_all' by a for loop: expand AT_TESTS_ALL. (AT_SETUP): Build AT_TESTS_ALL. (AT_BANNER): New. Adjust all the former banners to use it. (AT_CHECK): Don't trace the decoding of $?.
111 lines
2.3 KiB
Plaintext
111 lines
2.3 KiB
Plaintext
# -*- Autoconf -*-
|
|
|
|
AT_BANNER([M4sh.])
|
|
|
|
|
|
## ----------------------------- ##
|
|
## AS_DIRNAME & AS_DIRNAME_SED. ##
|
|
## ----------------------------- ##
|
|
|
|
# Build nested dirs.
|
|
|
|
AT_SETUP([[AS_DIRNAME & AS_DIRNAME_SED]])
|
|
|
|
AT_DATA(configure.in,
|
|
[[define([AS_DIRNAME_TEST],
|
|
[dir=`AS_DIRNAME([$1])`
|
|
test "$dir" = "$2" ||
|
|
echo "dirname($1) = $dir instead of $2" >&2
|
|
|
|
dir=`AS_DIRNAME_SED([$1])`
|
|
test "$dir" = "$2" ||
|
|
echo "dirname_sed($1) = $dir instead of $2" >&2])
|
|
|
|
AC_PLAIN_SCRIPT
|
|
AS_DIRNAME_TEST([//1], [//])
|
|
AS_DIRNAME_TEST([/1], [/])
|
|
AS_DIRNAME_TEST([./1], [.])
|
|
AS_DIRNAME_TEST([../../2], [../..])
|
|
AS_DIRNAME_TEST([//1/], [//])
|
|
AS_DIRNAME_TEST([/1/], [/])
|
|
AS_DIRNAME_TEST([./1/], [.])
|
|
AS_DIRNAME_TEST([../../2], [../..])
|
|
AS_DIRNAME_TEST([//1/3], [//1])
|
|
AS_DIRNAME_TEST([/1/3], [/1])
|
|
AS_DIRNAME_TEST([./1/3], [./1])
|
|
AS_DIRNAME_TEST([../../2/3], [../../2])
|
|
AS_DIRNAME_TEST([//1/3///], [//1])
|
|
AS_DIRNAME_TEST([/1/3///], [/1])
|
|
AS_DIRNAME_TEST([./1/3///], [./1])
|
|
AS_DIRNAME_TEST([../../2/3///], [../../2])
|
|
AS_DIRNAME_TEST([//1//3/], [//1])
|
|
AS_DIRNAME_TEST([/1//3/], [/1])
|
|
AS_DIRNAME_TEST([./1//3/], [./1])
|
|
AS_DIRNAME_TEST([../../2//3/], [../../2])
|
|
AS_EXIT(0)
|
|
]])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
AT_CHECK([./configure], 0)
|
|
|
|
AT_CLEANUP(configure)
|
|
|
|
|
|
|
|
## ------------ ##
|
|
## AS_MKDIR_P. ##
|
|
## ------------ ##
|
|
|
|
# Build nested dirs.
|
|
|
|
AT_SETUP([[AS_MKDIR_P]])
|
|
|
|
AT_DATA([configure.in],
|
|
[[AC_PLAIN_SCRIPT
|
|
pwd=`pwd`
|
|
set -e
|
|
# Absolute
|
|
AS_MKDIR_P(["$pwd/1/2/3/4/5/6"])
|
|
test -d "$pwd/1/2/3/4/5/6" ||
|
|
AC_MSG_ERROR([$pwd/1/2/3/4/5/6 has not been properly created])
|
|
# Relative
|
|
AS_MKDIR_P(["a/b/c/d/e/f"])
|
|
test -d a/b/c/d/e/f ||
|
|
AC_MSG_ERROR([a/b/c/d/e/f has not been properly created])
|
|
AS_EXIT(0)
|
|
]])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
AT_CHECK([./configure], 0)
|
|
|
|
AT_CLEANUP(configure 1 a)
|
|
|
|
|
|
|
|
|
|
## ----------------------------- ##
|
|
## Negated classes in globbing. ##
|
|
## ----------------------------- ##
|
|
|
|
# It is known that `[^...]' is not universally supported, but it is
|
|
# unknown for `[!...]'.
|
|
|
|
AT_SETUP([Negated classes in globbing])
|
|
|
|
AT_DATA([configure.in],
|
|
[[AC_PLAIN_SCRIPT
|
|
case 'with!two!bangs' in
|
|
*[[!a-z]]*) ;;
|
|
*) AC_MSG_ERROR([[`*[!a-z]*' didn't match `with!two!bangs']]);;
|
|
esac
|
|
|
|
case without in
|
|
*[[!a-z]]*) AC_MSG_ERROR([[`*[!a-z]*' matched `without']]);;
|
|
esac
|
|
]])
|
|
|
|
AT_CHECK_AUTOCONF
|
|
AT_CHECK([./configure], 0)
|
|
|
|
AT_CLEANUP(configure)
|