nmh-commits
[Top][All Lists]
Advanced

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

[Nmh-commits] nmh/test README runtest


From: Peter Maydell
Subject: [Nmh-commits] nmh/test README runtest
Date: Sun, 03 Aug 2008 15:13:34 +0000

CVSROOT:        /sources/nmh
Module name:    nmh
Changes by:     Peter Maydell <pm215>   08/08/03 15:13:34

Modified files:
        test           : README runtest 

Log message:
        Allow tests to indicate that they have been skipped by printing their
        own message and returning with exit status 120.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/test/README?cvsroot=nmh&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/nmh/test/runtest?cvsroot=nmh&r1=1.2&r2=1.3

Patches:
Index: README
===================================================================
RCS file: /sources/nmh/nmh/test/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- README      17 Apr 2007 01:02:08 -0000      1.1
+++ README      3 Aug 2008 15:13:34 -0000       1.2
@@ -3,7 +3,14 @@
 The purpose of these tests is to verify the functionality of the nmh
 commands.  The goal of the suite is to create an environment where testing
 nmh commands is easy and useful.  Each test is a shell script, and is
-launched via the 'sh' command.
+launched via the 'sh' command. The script should run the test and report
+the result by one of:
+
+  * for a test pass: exit with status 0
+  * where a test has been skipped (perhaps because it depends on an
+    external program which can't be found): print "Test $0 SKIP (reason)"
+    and exit with status 120
+  * for a test fail: exit with some status other than 0 or 120
 
 The Suite is arranged as such:
 

Index: runtest
===================================================================
RCS file: /sources/nmh/nmh/test/runtest,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- runtest     25 Jul 2008 00:11:54 -0000      1.2
+++ runtest     3 Aug 2008 15:13:34 -0000       1.3
@@ -29,6 +29,11 @@
 
 if [ $return_value -eq 0 ] ; then
     echo Test $1 PASS
+elif [ $return_value -eq 120 ]; then
+    # indicates test was skipped (eg needed program not found)
+    # test itself should have printed a message about this,
+    # so print nothing here.
+    :
 else
     echo Test $1 FAIL
 fi




reply via email to

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