From 362c41181c0a68bf41310dceee47c50ed95afbcb Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Mon, 15 Aug 2005 23:47:57 +0000 Subject: [PATCH] * tests/autoscan.at (autoscan): New file. * tests/suite.at: Use it. * tests/Makefile.am (TESTSUITE_HAND_AT): Add it. Reported against Libtool by Gideon Go . * tests/autotest.at (Keywords): Test keywords combinations. --- ChangeLog | 9 +++++++++ tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/autoscan.at | 50 +++++++++++++++++++++++++++++++++++++++++++++++ tests/autotest.at | 50 +++++++++++++++++++++++++++++++++++++++++++++++ tests/suite.at | 3 +++ 6 files changed, 114 insertions(+) create mode 100644 tests/autoscan.at diff --git a/ChangeLog b/ChangeLog index ad58c9c6..90721d2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-08-15 Ralf Wildenhues + + * tests/autoscan.at (autoscan): New file. + * tests/suite.at: Use it. + * tests/Makefile.am (TESTSUITE_HAND_AT): Add it. + Reported against Libtool by Gideon Go . + + * tests/autotest.at (Keywords): Test keywords combinations. + 2005-08-12 Stepan Kasal * Makefile.maint (GZIP_ENV): When checking the help text of gzip, diff --git a/tests/Makefile.am b/tests/Makefile.am index 6d2c3b2f..30d5175b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -91,6 +91,7 @@ TESTSUITE_HAND_AT = \ base.at tools.at torture.at \ compile.at c.at fortran.at \ semantics.at \ + autoscan.at \ foreign.at TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT) diff --git a/tests/Makefile.in b/tests/Makefile.in index 610577b7..3f8c4dc6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -219,6 +219,7 @@ TESTSUITE_HAND_AT = \ base.at tools.at torture.at \ compile.at c.at fortran.at \ semantics.at \ + autoscan.at \ foreign.at TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT) diff --git a/tests/autoscan.at b/tests/autoscan.at new file mode 100644 index 00000000..157323db --- /dev/null +++ b/tests/autoscan.at @@ -0,0 +1,50 @@ +# -*- Autotest -*- + +AT_BANNER([Autoscan.]) + +# Copyright (C) 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AT_SETUP([autoscan]) +AT_XFAIL_IF(:) + +AT_DATA([Makefile.am], +[[SUBDIRS = subpkg +]]) + +AT_DATA([configure.ac], +[[AC_INIT +AC_PREREQ(2.59) +AM_INIT_AUTOMAKE(foreign) +AC_CONFIG_SUBDIRS(subpkg) +AC_CONFIG_FILES(Makefile) +AC_OUTPUT +]]) + +mkdir subpkg + +AT_DATA([subpkg/Makefile.am], []) +AT_DATA([subpkg/configure.ac], +[[AC_INIT +AM_INIT_AUTOMAKE(foreign) +AC_CONFIG_FILES(Makefile) +AC_OUTPUT +]]) +AT_CHECK([autoscan]) +AT_CHECK([grep subpkg/Makefile configure.scan], [1], [], [ignore]) + +AT_CLEANUP diff --git a/tests/autotest.at b/tests/autotest.at index 0776444f..b0f07351 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -241,3 +241,53 @@ AT_CHECK_AT_TITLE_CHAR([Backquote], [`], [:]) AT_CHECK_AT_TITLE_CHAR([Single-quote], ['], [:]) AT_CHECK_AT_TITLE_CHAR([Double-quote], ["], [:]) AT_CHECK_AT_TITLE_CHAR([Backslash], [\]) + + +## --------- ## +## Keywords. ## +## --------- ## +AT_SETUP([Keywords]) +AT_KEYWORDS([autotest]) +AT_XFAIL_IF(:) + +AT_DATA([k.at], +[[m4_define([AT_PACKAGE_STRING],[k]) +m4_define([AT_PACKAGE_BUGREPORT],[devnull]) +AT_INIT +AT_SETUP(none) +AT_CHECK(:) +AT_CLEANUP +AT_SETUP(first) +AT_KEYWORDS(key1) +AT_CHECK(:) +AT_CLEANUP +AT_SETUP(second) +AT_KEYWORDS(key2) +AT_CHECK(:) +AT_CLEANUP +AT_SETUP(both) +AT_KEYWORDS(key1) +AT_KEYWORDS(key2) +AT_CHECK(:) +AT_CLEANUP +]]) +AT_CHECK_AUTOM4TE([--language=autotest -o k k.at]) + +# AT_CHECK_EGREP(PATTERN, STATUS, COUNT) +m4_define([AT_CHECK_EGREP], +[AT_CHECK([$EGREP -c '$1' stdout], $2, [$3 +], ignore) +]) + +# AT_CHECK_KEYS(TESTSUITE-OPTIONS, PATTERN1, COUNT1, PATTERN2, COUNT2) +m4_define([AT_CHECK_KEYS], +[AT_CHECK([./k $1], 0, [stdout]) +AT_CHECK_EGREP([$2], 0, [$3]) +AT_CHECK_EGREP([$4], 1, [$5]) +]) + +AT_CHECK_KEYS([-k key1], [first|both], [2], [none|second], [0]) +AT_CHECK_KEYS([-k key2], [second|both], [2], [none|first], [0]) +AT_CHECK_KEYS([-k key1,key2], [both], [1], [none|first|second], [0]) +AT_CHECK_KEYS([-k key1 -k key2], [first|second|both], [3], [none], [0]) +AT_CLEANUP diff --git a/tests/suite.at b/tests/suite.at index ef8548c9..ff2a300b 100644 --- a/tests/suite.at +++ b/tests/suite.at @@ -72,3 +72,6 @@ m4_include([aclibs.at]) # Compatibility with foreign tools. m4_include([foreign.at]) + +# Autoscan test +m4_include([autoscan.at])