Function SAFE_CALL() added into LTP test interface:
SAFE_CALL command arg1 arg2 ...
instead of
command arg1 arg2 ...
if [ $? -ne 0 ]; then
tst_brkm TBROK "..."
fi
Function SAFE_CALL_REDIRECT() added into LTP test interface:
SAFE_CALL_REDIRECT command arg1 arg2 ... > redirect_output
instead of
command arg1 arg2 ... > redirect_output
if [ $? -ne 0 ]; then
tst_brkm TBROK "..."
fi
Signed-off-by: Zeng Linggang <[email protected]>
---
testcases/lib/test.sh | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
index 927a647..59df20e 100644
--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -177,6 +177,22 @@ tst_timeout()
return $ret
}
+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
+}
+
# Check that test name is set
if [ -z "$TCID" ]; then
tst_brkm TBROK "TCID is not defined"
--
1.9.3
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list