Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmansk...@oracle.com> ---
Sorry for late response. doc/test-writing-guidelines.txt | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt index 4d70a1b..a0004d8 100644 --- a/doc/test-writing-guidelines.txt +++ b/doc/test-writing-guidelines.txt @@ -994,6 +994,33 @@ exactly as 'umount(2)' but retries several times on a failure. IMPORTANT: All testcases should use 'tst_umount()' instead of 'umount(2)' to umount filesystems. +2.2.20 Executing a file +^^^^^^^^^^^^^^^^^^^^^^^ + +[source,c] +------------------------------------------------------------------------------- +#include "test.h" + +int tst_run_cmd(void (cleanup_fn)(void), + const char *const argv[], + const char *stdout_path, + const char *stderr_path, + int pass_exit_val); +------------------------------------------------------------------------------- + +'tst_run_cmd' is a wrapper for 'vfork() + execvp()' which provides a way to execute +an external program. + +'argv[]' is a NULL-terminated list of pointers to the program name and its optional +arguments. + +A non-zero 'pass_exit_val' makes 'tst_run_cmd' return the program exit code to +the caller. A zero for 'pass_exit_val' makes 'tst_run_cmd' call 'cleanup_fn' +in case the program exits with a non-zero code. + +'stdout_path' and 'stderr_path' detirmine where to redirect the program +stdout and stderr I/O streams. + 2.3 Writing a testcase in shell ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 1.7.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list