* this patch adds the functions report_begin and report_and
          into the libptxdisttest.sh test library. This will probably
          break the output of some older testscripts depending this
          library.

        * this patch also repairs a bug in the host function of the
          libptxdisttest.h which did not correctly handle the return
          value of the evaluated commandline

Signed-off-by: Michael Grzeschik <[email protected]>
---
 tests/libptxdisttest.sh |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/libptxdisttest.sh b/tests/libptxdisttest.sh
index 5e79b63..151a929 100644
--- a/tests/libptxdisttest.sh
+++ b/tests/libptxdisttest.sh
@@ -14,7 +14,6 @@ 
REPORTFILE="${PTXDIST_WORKSPACE}/test${PTXDIST_PLATFORMSUFFIX}.report"
 TESTRUNDIRBASE="${PTXDIST_WORKSPACE}/results/result${PTXDIST_PLATFORMSUFFIX}"
 [ -d "$TESTRUNDIRBASE" ] || mkdir -p "$TESTRUNDIRBASE"
 
-echo "<report starttime=\""$(date +%FT%T.%N)"\">" > "$REPORTFILE"
 
 RED='\0033[1;31m'
 GREEN='\0033[1;32m'
@@ -99,6 +98,15 @@ reportwrite() {
        esac
 }
 
+report_begin() {
+       echo "<report starttime=\""$(date +%FT%T.%N)"\">" > "$REPORTFILE"
+}
+
+report_end() {
+       echo "</report>" >> "$REPORTFILE"
+       cp "$REPORTFILE" 
"$TESTRUNDIRBASE/test${PTXDIST_PLATFORMSUFFIX}-${datenohyphen}-${testrunseq}.report"
+}
+
 test_begin() {
        (( testseq++ ))
        local testname=${FUNCNAME[1]/"acctest_"}
@@ -121,7 +129,7 @@ test_end() {
 }
 
 checking() {
-       printf "%-71s" "checking $1" >&2
+       printf "%-71s\n" "checking $1" >&2
        reportwrite checking "$1"
 }
 
@@ -190,10 +198,12 @@ remote() {
 }
 
 host() {
+       local stdout=""
+
        echo "${1}" >> "$LOGFILE"
        reportwrite host "${1}"
-       local stdout=$(eval ${1}) 2>> "$LOGFILE"
-       local retval=$?
+       stdout=$(eval ${1}; exit ${?}) 2>>"$LOGFILE"
+       local retval=${?}
        reportwrite stdout "${stdout}"
        reportwrite exitstatus ${retval}
        echo "$stdout"
-- 
1.7.0


-- 
ptxdist mailing list
[email protected]

Reply via email to