From: Cyril Hrubis <chrubis@suse.cz>
To: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Cc: ltp-list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [RFC PATCH v2 1/2] testcases/lib/test.sh: added SAFE_CALL*()
Date: Wed, 22 Apr 2015 14:47:39 +0200 [thread overview]
Message-ID: <20150422124738.GA32110@rei> (raw)
In-Reply-To: <1429010688.7190.24.camel@G08JYZSD130126.localdomain>
Hi!
> +SAFE_CALL()
> +{
> + $@ > /dev/null 2>&1
> + if [ $? -ne 0 ]; then
> + tst_brkm TBROK "$@ failed"
> + fi
> +}
> +
> +SAFE_CALL_REDIRECT()
> +{
> + $@
> + if [ $? -ne 0 ]; then
> + tst_brkm TBROK "$@ failed"
> + fi
> +}
Looks good but the names are a bit confusing. The SAFE_CALL does
redirect the output while SAFWE_CALL_REDIRECT does not.
Maybe naming the first SAFE_SILENT() and the second just SAFE() would be
better. And because this is not too much similar to the C interface we
can name it even more differently. Shorthand for "run or die" would be
ROD_SILENT and ROD.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-04-22 12:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 10:35 [LTP] [RFC PATCH] commands/du: Added new testcase to test du(1) command Zeng Linggang
2015-04-02 11:59 ` Cyril Hrubis
[not found] ` <1429010688.7190.24.camel@G08JYZSD130126.localdomain>
2015-04-22 12:47 ` Cyril Hrubis [this message]
[not found] ` <1429755598.2416.14.camel@G08JYZSD130126.localdomain>
2015-04-23 10:27 ` [LTP] [RFC PATCH v2 1/2] testcases/lib/test.sh: added SAFE_CALL*() Cyril Hrubis
[not found] ` <1429010747.7190.25.camel@G08JYZSD130126.localdomain>
2015-04-22 12:58 ` [LTP] [RFC PATCH v2 2/2] commands/du: Added new testcase to test du(1) command Cyril Hrubis
[not found] ` <1429784431-14017-1-git-send-email-zenglg.jy@cn.fujitsu.com>
2015-04-28 14:10 ` [LTP] [PATCH v3 1/2] testcases/lib/test.sh: Added ROD_SILENT() and ROD() Cyril Hrubis
[not found] ` <1430270054.7745.11.camel@G08JYZSD130126.localdomain>
[not found] ` <55417DFD.1040207@huawei.com>
2015-04-30 7:51 ` Cyril Hrubis
2015-04-30 7:52 ` Cyril Hrubis
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=20150422124738.GA32110@rei \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=zenglg.jy@cn.fujitsu.com \
/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