mirror of
git://git.sv.gnu.org/autoconf
synced 2024-11-27 01:49:56 +08:00
7eadb5fda3
* tests/README: New file. * tests/semantics.at: Don't just `exit 1' or `exit 77' from configure.in: call AC_MSG_ERROR. * tests/base.m4: Likewise. * tests/m4sh.at: Likewise. * tests/semantics.at (AT_CHECK_PROGS_PREPARE): New macro, eved out of... (AC_CHECK_PROG & AC_PATH_PROG): here. Split into two individual tests... (AC_CHECK_PROG & AC_CHECK_PROGS, AC_PATH_PROG & AC_PATH_PROGS): these.
109 lines
2.6 KiB
Plaintext
109 lines
2.6 KiB
Plaintext
# -*- Autoconf -*-
|
|
|
|
cat <<EOF
|
|
|
|
Autoshell.
|
|
|
|
EOF
|
|
|
|
|
|
## ------------ ##
|
|
## AS_MKDIR_P. ##
|
|
## ------------ ##
|
|
|
|
# Build nested dirs.
|
|
|
|
AT_SETUP(AC_SHELL_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])
|
|
exit 0
|
|
]])
|
|
|
|
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
|
|
AT_CHECK([./configure], 0)
|
|
|
|
AT_CLEANUP(configure 1 a)
|
|
|
|
|
|
|
|
## ----------------------------- ##
|
|
## 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])
|
|
define([AS_DIRNAME_SED_TEST],
|
|
[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_DIRNAME_SED_TEST([//1], [//])
|
|
AS_DIRNAME_SED_TEST([/1], [/])
|
|
AS_DIRNAME_SED_TEST([./1], [.])
|
|
AS_DIRNAME_SED_TEST([../../2], [../..])
|
|
AS_DIRNAME_SED_TEST([//1/], [//])
|
|
AS_DIRNAME_SED_TEST([/1/], [/])
|
|
AS_DIRNAME_SED_TEST([./1/], [.])
|
|
AS_DIRNAME_SED_TEST([../../2], [../..])
|
|
AS_DIRNAME_SED_TEST([//1/3], [//1])
|
|
AS_DIRNAME_SED_TEST([/1/3], [/1])
|
|
AS_DIRNAME_SED_TEST([./1/3], [./1])
|
|
AS_DIRNAME_SED_TEST([../../2/3], [../../2])
|
|
AS_DIRNAME_SED_TEST([//1/3///], [//1])
|
|
AS_DIRNAME_SED_TEST([/1/3///], [/1])
|
|
AS_DIRNAME_SED_TEST([./1/3///], [./1])
|
|
AS_DIRNAME_SED_TEST([../../2/3///], [../../2])
|
|
AS_DIRNAME_SED_TEST([//1//3/], [//1])
|
|
AS_DIRNAME_SED_TEST([/1//3/], [/1])
|
|
AS_DIRNAME_SED_TEST([./1//3/], [./1])
|
|
AS_DIRNAME_SED_TEST([../../2//3/], [../../2])
|
|
exit 0
|
|
]])
|
|
|
|
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
|
|
AT_CHECK([./configure], 0)
|
|
|
|
AT_CLEANUP(configure)
|