mirror of
git://git.sv.gnu.org/autoconf
synced 2025-01-06 10:25:53 +08:00
f6dd7456f3
Introduce a new style of testing, independent from DejaGNU. Introduce the logistics. * configure.in: Initialize AT, and output tests/atconfig, and tests/Makefile. * m4/atconfig.m4: New file. * m4/Makefile.am: Adjusted. * aclocal.m4: Include atconfig.m4. * Makefile.am: Adjusted. * tests/Makefile.am: New file. * tests/atgeneral.m4: Likewise. * tests/atconfig.in: Likewise. Write tests. * tests/syntax.m4: New file, in charge of checking the validity of the sh code produced by the macros defined in acspecific.m4. acgeneral.m4 is not checked here, because these macros require arguments. * tests/suite.m4: New file. Run syntax.m4.
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
## ----------------------##
|
|
## Prepare for testing. ##
|
|
## ----------------------##
|
|
|
|
# Single argument says where are built sources to test, relative to the
|
|
# built test directory. Maybe omitted if the same (flat distribution).
|
|
|
|
AC_DEFUN(AT_CONFIG,
|
|
[AT_TESTPATH=ifelse($1, , ., $1)
|
|
AC_SUBST(AT_TESTPATH)
|
|
fp_PROG_ECHO
|
|
])
|
|
|
|
## ----------------------------------------- ##
|
|
## Find how to suppress newlines with echo. ##
|
|
## ----------------------------------------- ##
|
|
|
|
# Once this macro is called, you may output with no echo in a Makefile or
|
|
# script using: echo @ECHO_N@ "STRING_TO_OUTPUT@ECHO_C@".
|
|
|
|
AC_DEFUN(fp_PROG_ECHO,
|
|
[AC_CACHE_CHECK(how to suppress newlines using echo, fp_cv_prog_echo_nonl,
|
|
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
|
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
|
fp_cv_prog_echo_nonl=no
|
|
else
|
|
fp_cv_prog_echo_nonl=option
|
|
fi
|
|
else
|
|
fp_cv_prog_echo_nonl=escape
|
|
fi
|
|
])
|
|
test $fp_cv_prog_echo_nonl = no \
|
|
&& echo 2>&1 "WARNING: \`echo' not powerful enough for \`make check'"
|
|
case $fp_cv_prog_echo_nonl in
|
|
no) ECHO_N= ECHO_C= ;;
|
|
option) ECHO_N=-n ECHO_C= ;;
|
|
escape) ECHO_N= ECHO_C='\c' ;;
|
|
esac
|
|
AC_SUBST(ECHO_N)dnl
|
|
AC_SUBST(ECHO_C)dnl
|
|
])
|