summaryrefslogtreecommitdiffstats
path: root/atf-c++/atf-c++-api.3
diff options
context:
space:
mode:
Diffstat (limited to 'atf-c++/atf-c++-api.3')
-rw-r--r--atf-c++/atf-c++-api.337
1 files changed, 14 insertions, 23 deletions
diff --git a/atf-c++/atf-c++-api.3 b/atf-c++/atf-c++-api.3
index d0579a9..c086c90 100644
--- a/atf-c++/atf-c++-api.3
+++ b/atf-c++/atf-c++-api.3
@@ -26,7 +26,7 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd November 30, 2012
+.Dd November 15, 2013
.Dt ATF-C++-API 3
.Os
.Sh NAME
@@ -145,17 +145,8 @@
.Fa "const std::string& expected_stderr"
.Fc
.Sh DESCRIPTION
-ATF provides a mostly-macro-based programming interface to implement test
-programs in C or C++.
-This interface is backed by a C++ implementation, but this fact is
-hidden from the developer as much as possible through the use of
-macros to simplify programming.
-However, the use of C++ is not hidden everywhere and while you can
-implement test cases without knowing anything at all about the object model
-underneath the provided calls, you might need some minimum notions of the
-language in very specific circumstances.
-.Pp
-C++-based test programs always follow this template:
+ATF provides a C++ programming interface to implement test programs.
+C++-based test programs follow this template:
.Bd -literal -offset indent
extern "C" {
.Ns ... C-specific includes go here ...
@@ -440,7 +431,7 @@ In particular, these are useful to write tests for command-line interfaces.
.Fa "const std::string& path"
.Fa "const std::string& prefix"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Prints the contents of
.Fa path
to the standard output, prefixing every line with the string in
@@ -452,7 +443,7 @@ to the standard output, prefixing every line with the string in
.Fa "const std::string& path"
.Fa "const std::string& contents"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Returns true if the given
.Fa path
matches exactly the expected inlined
@@ -464,7 +455,7 @@ matches exactly the expected inlined
.Fa "const std::string& source"
.Fa "const std::string& destination"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Copies the file
.Fa source
to
@@ -477,7 +468,7 @@ The permissions of the file are preserved during the code.
.Fa "const std::string& path"
.Fa "const std::string& contents"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Creates
.Fa file
with the text given in
@@ -488,7 +479,7 @@ with the text given in
.Fo atf::utils::file_exists
.Fa "const std::string& path"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Checks if
.Fa path
exists.
@@ -498,7 +489,7 @@ exists.
.Fo atf::utils::fork
.Fa "void"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Forks a process and redirects the standard output and standard error of the
child to files for later validation with
.Fn atf::utils::wait .
@@ -510,7 +501,7 @@ Fails the test case if the fork fails, so this does not return an error.
.Fa "const std::string& regexp"
.Fa "const Collection& collection"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Searches for the regular expression
.Fa regexp
in any of the strings contained in the
@@ -523,7 +514,7 @@ This is a template that accepts any one-dimensional container of strings.
.Fa "const std::string& regexp"
.Fa "const std::string& path"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Searches for the regular expression
.Fa regexp
in the file
@@ -536,7 +527,7 @@ The variable arguments are used to construct the regular expression.
.Fa "const std::string& regexp"
.Fa "const std::string& str"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Searches for the regular expression
.Fa regexp
in the string
@@ -547,7 +538,7 @@ in the string
.Fa "const int fd"
.Fa "const std::string& path"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Redirects the given file descriptor
.Fa fd
to the file
@@ -566,7 +557,7 @@ those spawned by
.Fa "const std::string& expected_stdout"
.Fa "const std::string& expected_stderr"
.Fc
-.Bd -offset indent
+.Bd -ragged -offset indent
Waits and validates the result of a subprocess spawned with
.Fn atf::utils::wait .
The validation involves checking that the subprocess exited cleanly and returned
OpenPOWER on IntegriCloud