If the output information is too long, we need a newline.
But tst_resm and tst_brkm only print $1 and $2.
This patch will make them print all parameters.
For example:
In <LTP>/testcases/network/multicast/mc_cmds
--------------------------------------------------------------------------------
...
113 ping -c2 -I $INTERFACE 224.0.0.1 > $PING_OUT
114 if [ $? -ne 0 ]; then
115 tst_resm TINFO "Trying to ping with $INTERFACE_DEVICE"\
116 "with the -I option instead of IP address"
...
122 fi
...
--------------------------------------------------------------------------------
If "ping -c2 -I $INTERFACE 224.0.0.1 > $PING_OUT" failed,
it just output "Trying to ping with $INTERFACE_DEVICE",
"with the -I option instead of IP address" would be discard.
After this patch, if "ping ..." failed the second string also output.
Signed-off-by: Zeng Linggang <[email protected]>
---
testcases/lib/test.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
index eecbfba..9606b21 100644
--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -45,9 +45,11 @@ tst_resm()
local mask=$?
LTP_RET_VAL=$((LTP_RET_VAL|mask))
- echo "$TCID $TST_COUNT $1 : $2"
+ local ret=$1
+ shift
+ echo "$TCID $TST_COUNT $ret : $@"
- case "$1" in
+ case "$ret" in
TPASS|TFAIL)
TST_COUNT=$((TST_COUNT+1));;
esac
@@ -62,7 +64,9 @@ tst_brkm()
*) tst_brkm TBROK "Invalid tst_brkm type '$1'";;
esac
- tst_resm "$1" "$2"
+ local ret=$1
+ shift
+ tst_resm "$ret" "$@"
tst_exit
}
--
1.9.3
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list