Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:b4daf2cf8e68f5668410a94a643dd4813e7c3779
Author...:karl <>
Committer:karl <>
Date.....:Tue Aug 22 20:23:15 2006 +0000
Parents..:79ca5368601da137dadecfa12eab89df3d225ba9

Message
[project @ 2006-08-22 20:23:15 by karl]
new test greeting-2, usually skipped

Changes
diff --git a/tests/ChangeLog b/tests/ChangeLog
line changes: +5/-0
index fb2aa00..0d30679
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-21  Bruno Haible  <bruno@clisp.org>
+
+	* greeting-moon: New file.
+	* Makefile.am (TESTS): Add it.
+
 2006-08-13  Karl Berry  <karl@gnu.org>
 
 	* *-1: Simplify, change sailor test to arbitrary greeting.

diff --git a/tests/Makefile.am b/tests/Makefile.am
line changes: +1/-1
index 9f938cb..e4137fc
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,7 +17,7 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
-TESTS = greeting-1 hello-1 traditional-1
+TESTS = greeting-1 greeting-2 hello-1 traditional-1
 
 EXTRA_DIST = $(TESTS)
 

diff --git a/tests/greeting-2 b/tests/greeting-2
line changes: +46/-0
index 0000000..37664e8
--- /dev/null
+++ b/tests/greeting-2
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Test very long --greeting argument.
+# 
+# Copyright (C) 2001, 2006 Free Software Foundation, Inc.  
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="greeting-test2.ok"
+cat <<EOF > greeting-test2.ok
+Wuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuhhh!
+EOF
+
+# Werewolves cry at full moon only.
+set - `TZ=GMT date +"%Y %j %H %M %S"`
+year=$1; day=$2; hours=$3; minutes=$4; seconds=$5
+years_since_2000=`expr $year - 2000`
+days_since_2000=`expr '(' $years_since_2000 '*' 365 ')' + '(' '(' $years_since_2000 - 1 ')' / 4 ')' + $day`
+seconds_since_2000=`expr '(' '(' '(' '(' '(' $days_since_2000 '*' 24 ')' + $hours ')' '*' 60 ')' + $minutes ')' '*' 60 ')' + $seconds`
+# A moon period is ca. 2551442.8 seconds.
+remainder=`expr $seconds_since_2000 % 2551443`
+# Full moon is around remainder = 1760000, oscillating between ca. 1720000
+# and ca. 1805000. Allow a tolerance of +/- 24 h.
+if test `expr $remainder '>' 1650000` = 0 || test `expr $remainder '<' 1890000` = 0; then
+  { echo "Skipping test: not a full moon night"; rm -fr $tmpfiles; exit 77; }
+fi
+
+# The exit 77 is the magic value which tells Automake's `make check'
+# that this test was skipped.  It's also good to give a
+# human-understandable reason why the test was skipped, so the person
+# running the test can know.
+
+tmpfiles="$tmpfiles greeting-test2.out"
+: ${HELLO=hello}
+${HELLO} -g 'Wuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuhhh!' > greeting-test2.out
+
+: ${DIFF=diff}
+${DIFF} greeting-test2.ok greeting-test2.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result

This website is licensed under AGPL-3.0. Feel free to copy!