public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 4/5] lib: Implement SAFE_CMD() macro (new API only)
Date: Mon, 30 Mar 2020 20:48:27 +0200	[thread overview]
Message-ID: <20200330184827.GA8636@dell5510> (raw)
In-Reply-To: <CAEemH2dcxrpB_dkp26=5oiMdY_2OVw5v_OjpyG37N+zx7y+A9g@mail.gmail.com>

Hi Li,

> > +       switch ((rval = tst_run_cmd(argv, stdout_path, stderr_path,
> > +                                   TST_RUN_CMD_PASS_EXIT_VAL |
> > +                                   TST_RUN_CMD_CHECK_CMD))) {


> This should be TST_CMD_TCONF_ON_MISSING ^.

> I'd help to build&run the whole patches tomorrow, anything wrong if I can
> find will reply to you then.

Thanks for fixes. Here is following diff from v2 (addressing issues you found,
fixed tst_run_cmd() being replaced in later commit, fix doc formatting),
code available also on:
https://github.com/pevik/ltp/tree/needs_cmds.v2.fixes

I'm going to test each commit if it builds and wait for your ack tomorrow.

Kind regards,
Petr

diff --git doc/test-writing-guidelines.txt doc/test-writing-guidelines.txt
index 75c2e517a..895f6c99d 100644
--- doc/test-writing-guidelines.txt
+++ doc/test-writing-guidelines.txt
@@ -1263,7 +1263,7 @@ different once the call returns and should be used only for rough estimates.
 int tst_cmd(const char *const argv[],
 	        const char *stdout_path,
 	        const char *stderr_path,
-			enum tst_cmd_flags flags);
+	        enum tst_cmd_flags flags);
 -------------------------------------------------------------------------------
 
 'tst_cmd()' is a wrapper for 'vfork() + execvp()' which provides a way
diff --git include/tst_safe_macros.h include/tst_safe_macros.h
index d050c5990..295800c1b 100644
--- include/tst_safe_macros.h
+++ include/tst_safe_macros.h
@@ -543,8 +543,8 @@ void safe_cmd(const char *file, const int lineno, const char *const argv[],
 {
 	int rval;
 
-	switch ((rval = tst_cmd(argv, stdout_path, stderr_path, TST_CMD_PASS_RETVAL
-							| TST_CMD_CHECK_CMD))) {
+	switch ((rval = tst_cmd(argv, stdout_path, stderr_path,
+				TST_CMD_PASS_EXIT_VAL | TST_CMD_TCONF_ON_MISSING))) {
 	case 0:
 		break;
 	default:

  parent reply	other threads:[~2020-03-30 18:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 12:43 [LTP] [PATCH v2 0/5] C API: .needs_cmds and SAFE_CMD() Petr Vorel
2020-03-30 12:43 ` [LTP] [PATCH v2 1/5] lib: Rename tst_run_cmd*() to tst_cmd*() Petr Vorel
2020-03-30 12:43 ` [LTP] [PATCH v2 2/5] lib/tst_cmd_*(): Turn int pass_exit_val into enum Petr Vorel
2020-03-30 12:43 ` [LTP] [PATCH v2 3/5] lib/tst_cmd_*(): Search for program in $PATH Petr Vorel
2020-03-30 12:43 ` [LTP] [PATCH v2 4/5] lib: Implement SAFE_CMD() macro (new API only) Petr Vorel
2020-03-30 13:01   ` Li Wang
2020-03-30 13:07     ` Li Wang
2020-03-30 18:48     ` Petr Vorel [this message]
2020-03-30 12:43 ` [LTP] [PATCH v2 5/5] Use SAFE_CMD() Petr Vorel
2020-03-30 13:23   ` Li Wang
2020-03-30 20:02     ` Petr Vorel
2020-03-30 20:29       ` Petr Vorel
2020-03-31  3:59       ` Li Wang
2020-03-31  5:03         ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200330184827.GA8636@dell5510 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox