From 2fe19ae2ffdf97200236049fcf0af62d0b64fb9d Mon Sep 17 00:00:00 2001
From: Johan Holmberg
Date: Thu, 19 Nov 2009 08:42:06 +0100
Subject: [PATCH] Added "set_path()" and "--no-exit-code" info.
---
doc/cmdtest.html | 20 +++++++++++++++++---
doc/cmdtest.txt | 17 +++++++++++++++--
2 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/doc/cmdtest.html b/doc/cmdtest.html
index a42ba6c..28ef34d 100644
--- a/doc/cmdtest.html
+++ b/doc/cmdtest.html
@@ -412,6 +412,9 @@ skipped. But all errors occurring at the same command will be reported.
Cmdtest can also be directed to write an XML file on the same format as
that used by Ant/JUnit. This makes it possible to use Cmdtest together
with continuous integration servers like Hudson.
+
@@ -521,8 +524,10 @@ executed in the
cmd c
UN*X) or in a BAT file (on Windows). The
PATH in effect when
cmdtest is invoked is kept intact, with one addition: the current
directory at the time of invocation is prepended to the
PATH. If
-further changes to the
PATH are needed the methods
prepend_path or
-
prepend_local_path can be used.
+further changes to the
PATH are needed the methods
prepend_path,
+
prepend_local_path or
set_path can be used. Such path modifications
+does not survive between test methods. Each new test method starts with the
+original value of
PATH.
@@ -618,6 +623,9 @@ all side-effects of commands.
Useful when running under a continuous integration server that
understands JUnit reports.
+--no-exit-code |
+Do not exit with a non-zero exit code if errors occurred. |
+
-i |
Run in "incremental" mode. experimental
Cmdtest will try to run only those test methods that are failed or
@@ -765,6 +773,8 @@ interval given as argument.
- create_file(filename, content)
- Create a file inside the "work directory".
+If the filename contains a directory part, intermediate directories are
+created if needed.
The content can be specified either as an array of lines or as
a string with the content of the whole file.
The filename is evaluated relative to the current directory at the
@@ -790,6 +800,10 @@ relative to the current directory in effect at the time of the call
are looked up using the modified PATH. A typical use is to add the directory
where the executable tested is located. The argument dir is evaluated
relative to the current directory in effect when cmdtest was invoked.
+- set_path(dir1, ..., dirN)
+- Set PATH to the given directories, so commands executed via cmd
+are looked up using the modified PATH. This method sets the whole PATH
+rather than modifying it (in contrast to prepend_path and prepend_local_path).
- touch_file(filename)
- "touch" a file inside the "work directory".
The filename is evaluated relative to the current directory at the
@@ -801,7 +815,7 @@ time of the call.
diff --git a/doc/cmdtest.txt b/doc/cmdtest.txt
index 8663445..89ffea5 100644
--- a/doc/cmdtest.txt
+++ b/doc/cmdtest.txt
@@ -102,6 +102,10 @@ Cmdtest can also be directed to write an XML file on the same format as
that used by Ant/JUnit. This makes it possible to use Cmdtest together
with `continuous integration`_ servers like Hudson_.
+The exit status of ``cmdtest`` will be non-zero if some errors occurred,
+otherwise zero. If errors should not affect exit code, the
+command line option ``--no-exit-code`` can be used.
+
Structure of a test-file
------------------------
@@ -219,8 +223,10 @@ executed in the ``cmd`` calls are evaluated in a shell script (on
UN*X) or in a BAT file (on Windows). The ``PATH`` in effect when
``cmdtest`` is invoked is kept intact, with one addition: the current
directory at the time of invocation is prepended to the ``PATH``. If
-further changes to the ``PATH`` are needed the methods ``prepend_path`` or
-``prepend_local_path`` can be used.
+further changes to the ``PATH`` are needed the methods ``prepend_path``,
+``prepend_local_path`` or ``set_path`` can be used. Such path modifications
+does not survive between test methods. Each new test method starts with the
+original value of ``PATH``.
Matching standard output content
--------------------------------
@@ -320,6 +326,9 @@ Options
Useful when running under a continuous integration server that
understands JUnit reports.
+--no-exit-code
+ Do not exit with a non-zero exit code if errors occurred.
+
-i
Run in "incremental" mode. **experimental**
Cmdtest will try to run only those test methods that are failed or
@@ -511,6 +520,10 @@ Helper functions
where the executable tested is located. The argument ``dir`` is evaluated
relative to the current directory in effect when ``cmdtest`` was invoked.
+``set_path(dir1, ..., dirN)``
+ Set ``PATH`` to the given directories, so commands executed via ``cmd``
+ are looked up using the modified ``PATH``. This method sets the whole ``PATH``
+ rather than modifying it (in contrast to ``prepend_path`` and ``prepend_local_path``).
``touch_file(filename)``
"touch" a file inside the "work directory".
|