]> diplodocus.org Git - nmh/blobdiff - test/README
Fix incorrect documentation about the install process for files in 'etc'.
[nmh] / test / README
index 9f890e2dcb2ee4646068f80cc20f38541167e9b3..1ac904f28a22e5047e92d8a4fa596d1718386507 100644 (file)
@@ -17,7 +17,7 @@ designed to work with Automake.  To run these tests you can do "make check"
 via the top-level Makefile.  This is also done automatically via
 "make distcheck".
 
-WARNING:  The test suite installs nmh and run the tests on that test
+WARNING:  The test suite installs nmh and runs the tests on that test
 installation.  If you run tests individually, they will not remove
 that test installation or check to see if it remains up to date with
 your nmh workspace.  You can run test/clean after a test to remove the
@@ -38,6 +38,35 @@ If you wish to write a new test script, here are the steps:
 
 - If you need additional files for your tests, be sure to add them to
   the EXTRA_DIST variable in Makefile.am.  Note that you should insure
-  that you access these files relative to the $MH_OBJ_DIR environment variable.
+  that you access these files relative to the $srcdir environment variable.
 
 - Verify that the test works with both "make check" and "make distcheck".
+
+Please use only Bourne shell and bare-bones POSIX program constructs
+in the test scripts.  In particular:
+
+- Use `` instead of $().
+
+- Wrap shell variables with "" if they could possibly contain
+  whitespace or special characters that would affect syntax.
+
+- Use the arith_eval() function in common.sh instead of $(()) or expr.
+  It detects at run time if $(()) is available.
+
+- Use grep >/dev/null instead of grep -q.
+
+- Don't use egrep, grep -E, fgrep, grep -F, or other non-portable grep
+  functionality.  The built-in case statement supports alternation (|).
+
+- Don't use ! to negate conditions.  Instead, use something like:
+    <condition> || <statement>
+  or
+    if <condition>; then :; else <statements> fi
+
+- Separate variable assignment from export (don't assign in export
+  statements).
+
+- Use sed >tmpfile and mv instead of sed -i.
+
+- Avoid depending on the exact format of output from system (non-nmh)
+  programs.