automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Banner test for singletons.


From: William Pursell
Subject: [PATCH] Banner test for singletons.
Date: Sat, 11 Oct 2008 07:34:43 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)


    Test for fence post case in the banner.

    Treating test counts of one as a special case in
    the banner (eg printing "1 test passed" instead of
    "All 5 tests passed") requires checks for all
    cases in which pass, fail, or skipped counts is 1.
    This test does not actually validate the text of
    the banner, but just ensures that things work as
    expected.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7f9ff9f..5993a4e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -77,6 +77,7 @@ backsl3.test \
 backsl4.test \
 badline.test \
 badprog.test \
+banner.test \
 block.test \
 bsource.test \
 canon.test \
diff --git a/tests/banner.test b/tests/banner.test
new file mode 100755
index 0000000..cdea821
--- /dev/null
+++ b/tests/banner.test
@@ -0,0 +1,57 @@
+#! /bin/sh
+# Copyright (C) 1999, 2001, 2002  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 3, 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, see <http://www.gnu.org/licenses/>.
+
+# Test to validate the test banner.  The purpose of this test is
+# to ensure that running make check with test counts of 1 work,
+# given that we modify the test banner when count == 1 as a
+# special case.
+
+. ./defs || Exit 1
+
+for name in pass fail skip; do
+       cat > $name-test <<- EOF
+       #!/bin/sh
+       case $name in
+               skip) exit 77;;
+               pass) exit 0;;
+               fail) exit 1;;
+       esac
+       EOF
+       chmod +x $name-test
+done
+
+cat > configure.in <<- EOF
+       AC_INIT([GNU Automake banner test], [0], [dev/null])
+       AM_INIT_AUTOMAKE([1.10a])
+       AC_CONFIG_FILES([Makefile])
+       AC_OUTPUT
+EOF
+
+echo TESTS = fail-test skip-test pass-test > Makefile.am
+$ACLOCAL || Exit 1
+$AUTOCONF || Exit 1
+$AUTOMAKE || Exit 1
+
+./configure || Exit 1
+
+if $MAKE check                            ; then Exit 1; fi
+if $MAKE check TESTS="fail-test"          ; then Exit 1; fi
+if $MAKE check TESTS="skip-test fail-test"; then Exit 1; fi
+if $MAKE check TESTS="pass-test fail-test"; then Exit 1; fi
+
+$MAKE check TESTS=skip-test             || Exit 1
+$MAKE check TESTS=pass-test             || Exit 1
+$MAKE check TESTS="pass-test skip-test" || Exit 1

--
William Pursell




reply via email to

[Prev in Thread] Current Thread [Next in Thread]