source: branches/dev-5819/jm_tests.in @ 13971

Last change on this file since 13971 was 13971, checked in by randersson, 4 weeks ago

#5819 Reverted all changes from jm_tests.in

File size: 18.3 KB
Line 
1#!/bin/bash
2# Script for running JModelica.org test suites.
3# Copy this file to somewhere in your PATH.
4# You may need to change variables below (in the copy) to match your system.
5# Type "tests -h" for usage.
6# Requires Unix-like system with bash, grep, dc, mktemp, uname and sed.
7
8merge_path() {
9  if [ "$1" = "" ]; then
10    if [ "$3" = "" ]; then
11      echo $2
12    else
13      echo $3@SEP@$2
14    fi
15  else
16    echo $1@SEP@$2
17  fi
18}
19
20# ====== Variables to set ======
21
22# Memory allocation for the ant process
23ANT_OPTS="-Xmx2g"
24
25# Default tests - run if no tests are chosen
26# Possible values: modelica, optimica, python or combination (e.g. "modelica optimica")
27DEFAULT_TESTS="optimica python"
28
29# Default arguments - always parse these arguments before command line
30DEFAULT_ARGS=""
31
32# Variables set by configure script
33JMODELICA_HOME="@prefix@"
34JMODELICA_SRC="@abs_top_srcdir@"
35IPOPT_HOME="@IPOPT_HOME@"
36IPOPT32_HOME="@IPOPT_HOME@"
37IPOPT64_HOME="@IPOPT64_HOME@"
38PYTHON64_HOME="@PYTHON64_HOME@"
39PYTHON32_HOME="@PYTHON_HOME@"
40SUNDIALS_HOME="@prefix@/ThirdParty/Sundials"
41CASADI_HOME="@prefix@/ThirdParty/CasADi"
42CASADI64_HOME="@prefix@/ThirdParty/CasADi64"
43CASADI_INTERFACE_HOME="@prefix@/lib/casadi_interface"
44CASADI_INTERFACE_HOME64="@prefix@/lib/casadi_interface64"
45CASADI_INTERFACE_HOME32=${CASADI_INTERFACE_HOME}
46ECLIPSE_HOME="@ECLIPSE_HOME@"
47JPYPE32_JVM="@JVMDLL_HOME@/jvm.dll"
48JPYPE64_JVM="@JVMDLL64_HOME@/jvm.dll"
49ORIG_PATH="@ORIG_PATH@"
50BUILD="@abs_builddir@"
51if [[ "${JAVA_HOME}" == "" ]]; then
52  JAVA_HOME="@_JAVA_HOME_@"
53fi
54
55if [[ "${PYTHON64_HOME}" != "" ]]; then
56DEFAULT_TESTS="${DEFAULT_TESTS} python64"
57fi
58
59# ====== End variables to set ======
60
61# Configure Bash
62set -o pipefail
63
64PYTHONPATH64="${JMODELICA_HOME}/Python_64/"
65PYTHONPATH32="$(merge_path "${PYTHONPATH}" "${JMODELICA_HOME}/Python/")"
66PYTHONPATH="$PYTHONPATH32"
67
68# To know if we are running python 64 tests
69PYTHON64=0
70
71# Default paths to ant files used for unit tests
72if [[ -z "${MC_ANT_ARGS}" ]]; then
73    MC_ANT_ARGS=${JMODELICA_SRC}/Compiler/ModelicaCompiler/build.xml
74fi
75if [[ -z "${OC_ANT_ARGS}" ]]; then
76    OC_ANT_ARGS=${JMODELICA_SRC}/Compiler/OptimicaCompiler/build.xml
77fi
78
79# Find operating system
80SYS="$(uname -s)"
81if [[ "${SYS}" == "Darwin" ]]; then
82  SYS=Mac
83elif [[ "${SYS:0:5}" == "MINGW" ]]; then
84  SYS=Win
85fi
86
87# Update library path
88if [[ "${SUNDIALS_HOME}" != "" ]]; then
89  LIB_PATH="${SUNDIALS_HOME}/lib"
90fi
91if [[ "${IPOPT_HOME}" != "" ]]; then
92  LIB_PATH="$(merge_path "${LIB_PATH}" "${IPOPT_HOME}/lib")"
93fi
94if [[ "${CASADI_HOME}" != "" ]]; then
95  LIB_PATH="$(merge_path "${LIB_PATH}" "${CASADI_HOME}/lib")"
96fi
97if [[ "${LIB_PATH}" != "" ]]; then
98  LD_LIBRARY_PATH="$(merge_path "${LD_LIBRARY_PATH}" "${LIB_PATH}" /lib)"
99fi
100
101# Test sets
102if [[ "${PYTHON64_HOME}" != "" ]]; then
103    test_set_a="modelica optimica python python64"
104    tests="modelica optimica python python64"
105else
106    test_set_a="modelica optimica python"
107    tests="modelica optimica python"
108fi
109test_set_j="modelica optimica"
110test_set_m="modelica"
111test_set_o="optimica"
112test_set_p="python"
113test_set_z="python64"
114
115# Standard set of tags
116TAGS="-a stddist_base -a noncompliantfmi"
117if [[ "${IPOPT_HOME}" != "" ]]; then
118  TAGS="${TAGS} -a ipopt"
119  if [[ "${SYS}" == Win ]]; then
120    TAGS="${TAGS} -a windows_base"
121  fi
122  if [[ -e "${JMODELICA_HOME}/Python/casadi" ]]; then
123    TAGS="${TAGS} -a casadi_base"
124  else
125    echo Skipping casadi tests, since CasADi does not seem to be installed.
126  fi
127fi
128
129# Standard set of tags
130TAGS64="-a stddist_base -a noncompliantfmi"
131if [[ "${IPOPT64_HOME}" != "" ]]; then
132  TAGS64="${TAGS64} -a ipopt"
133  if [[ "${SYS}" == Win ]]; then
134    TAGS64="${TAGS64} -a windows_base"
135  fi
136  if [[ -e "${JMODELICA_HOME}/Python_64/casadi" ]]; then
137    TAGS64="${TAGS64} -a casadi_base"
138  else
139    echo Skipping casadi tests, since CasADi does not seem to be installed.
140  fi
141fi
142
143# Extend with all tests for default version of Python/bitness
144if [[ "${PYTHON64_HOME}" != "" ]]; then
145    TAGS64="${TAGS64} -a stddist_full"
146    if [[ "${IPOPT64_HOME}" != "" ]]; then
147        if [[ "${SYS}" == Win ]]; then
148            TAGS64="${TAGS64} -a windows_full"
149        fi
150        if [[ -e "${JMODELICA_HOME}/Python_64/casadi" ]]; then
151            TAGS64="${TAGS64} -a casadi_full"
152        fi
153    fi 
154else
155    TAGS="${TAGS} -a stddist_full"
156    if [[ "${IPOPT_HOME}" != "" ]]; then
157        if [[ "${SYS}" == Win ]]; then
158            TAGS="${TAGS} -a windows_full"
159        fi
160        if [[ -e "${JMODELICA_HOME}/Python/casadi" ]]; then
161            TAGS="${TAGS} -a casadi_full"
162        else
163            echo Skipping casadi tests, since CasADi does not seem to be installed.
164        fi
165    fi
166fi
167
168# Functions for running specific tests
169function modelica_tests() {
170  junit_test Modelica
171}
172
173function optimica_tests() {
174  junit_test Optimica
175}
176
177TESTS_DIR="${JMODELICA_HOME}/Python/tests_jmodelica"
178function find_python_tests() {
179  if [[ "${TESTS}" == "" ]]; then
180    TESTS="$(find ${TESTS_DIR} -name \*.py | grep test_)"
181  fi
182}
183
184function python_tests() {
185  if [ "${KEEP_PYTHON}" == 1 ]; then
186    TEST_DIR="$(pwd)/tests_$(date "+%F_%H-%M-%S")"
187    mkdir ${TEST_DIR}
188  else
189    TEST_DIR=$(mktemp -dq /tmp/jm_tests.XXXXXX)
190  fi
191  print_name Python
192  res=0
193  case ${OUTPUT} in
194    v)
195      if build_jmodelica 2>&1 | log; then
196        find_python_tests
197        cd ${TEST_DIR}
198        python_tests_v || res=1
199      fi
200      ;;
201    q)
202      if build_jmodelica 2>&1 | log > /dev/null; then
203        find_python_tests
204        cd ${TEST_DIR}
205        python_tests_q | filter_python_separate || res=1
206      else
207        echo BUILD FAILED
208      fi
209      ;;
210    n)
211      if [[ "${NO_BUILD_JMODELICA}" != "1" ]]; then
212        echo Building...
213      fi
214      if build_jmodelica | log > /dev/null; then
215        find_python_tests
216        cd ${TEST_DIR}
217        python_tests_n | filter_python_separate || res=1
218      fi
219      ;;
220  esac
221  if [ ! "${KEEP_PYTHON}" == 1 ]; then
222    cd ..
223    rm -rf ${TEST_DIR}
224  fi
225  return $res
226}
227
228TESTS64_DIR="${JMODELICA_HOME}/Python_64/tests_jmodelica"
229function python64_tests() {
230    # Set necessary paths etc to run 64 bit tests
231    PYTHONPATH=${PYTHONPATH64}
232    PYTHONHOME=${PYTHON64_HOME}
233    JPYPE_JVM=${JPYPE64_JVM}
234    CASADI_LIB_HOME=${CASADI64_HOME}/lib
235    CASADI_INTERFACE_HOME=${CASADI_INTERFACE_HOME64}
236    PATH=${PYTHON64_HOME}:${PYTHON64_HOME}/Scripts:${PYTHON64_HOME}/Lib:${IPOPT64_HOME}/bin:${CASADI_LIB_HOME}:"${PATH}"
237    TESTS32=$TESTS
238    TESTS=$TESTS64
239    TAGS32=$TAGS
240    TAGS=$TAGS64
241    TESTS_DIR=${TESTS64_DIR}
242    PYTHON64=1
243    # Call python_tests
244    res=0
245    python_tests || res=1
246    # Reset to original paths etc that was for original Python
247    TESTS=$TESTS32
248    TAGS=$TAGS32
249    PYTHON64=0
250    PYTHONPATH=${PYTHONPATH32}
251    PYTHONHOME=${PYTHON32_HOME}
252    JPYPE_JVM=${JPYPE32_JVM}
253    CASADI_LIB_HOME=${CASADI_HOME}/lib
254    CASADI_INTERFACE_HOME=${CASADI_INTERFACE_HOME32}
255    PATH="${ORIG_PATH}"
256    TESTS_DIR="${JMODELICA_HOME}/Python/tests_jmodelica"
257    return $res
258}
259
260function python_tests_v() {
261    res=0
262    for TEST in ${TESTS}; do
263      echo ""
264      echo ${TEST} | sed -e 's!^.*jmodelica.!Running !'
265      nose_test ${TEST} \
266      | log \
267      || res=1
268    done
269    return $res
270}
271
272function python_tests_q() {
273    res=0
274    for TEST in ${TESTS}; do
275      echo "" | log > /dev/null
276      echo ${TEST} | sed -e 's!^.*jmodelica.!Running !' | log > /dev/null
277      nose_test ${TEST} 2>&1 \
278      | log \
279      | sed -n -e 's!^OK$!PASSED!ip' -e 's!^FAILED !TEST FAILED!p' \
280      || (res=1 && echo NOSETESTS_NOT_OK)
281    done
282    return $res
283}
284
285function python_tests_n() {
286    PATTERN="[-=]{40,}"
287    res=0
288    for TEST in ${TESTS}; do
289      echo "" | log
290      echo ${TEST} | sed -e 's!^.*jmodelica.!Running !' | log
291      nose_test ${TEST} 2>&1 \
292      | log \
293      | egrep -v '^Exception .* ignored$' \
294      | egrep -A500 "${PATTERN}" \
295      | sed -e 's!^OK$!PASSED!' -e 's!^FAILED !TEST FAILED!' \
296      || (res=1 && echo NOSETESTS_NOT_OK)
297    done
298    return $res
299}
300
301# Helper functions
302function print_name() {
303  if [[ "${OUTPUT}" == q ]]; then
304    echo -n "$1... "
305  else
306    echo ======= $1 =======
307  fi
308}
309
310function log() {
311  if [ "${LOG}" == 1 ]; then
312      tee -a "${LOGFILE}"
313  else
314      cat
315  fi
316}
317
318function filter_python_separate() {
319  TMP=$(mktemp -q /tmp/jm_tests.XXXXXX 2>/dev/null) 
320  tee ${TMP} | egrep -v "(PASSED|TEST FAILED|NOSETESTS_NOT_OK)"
321  cat ${TMP} \
322  | sed -n \
323        -e '1 i\
324            0 0 0' \
325        -e 's!^TEST FAILED(errors=\([0-9]*\))!\1+!p' \
326        -e 's!^TEST FAILED(failures=\([0-9]*\))!r\1+r!p' \
327        -e 's!^TEST FAILED(errors=\([0-9]*\), failures=\([0-9]*\))!\1+r\2+r!p' \
328        -e 's!^NOSETESTS_NOT_OK!sar1+rla!p' \
329        -e '$ a\
330            n[ ]nn[ ]np' \
331  | dc \
332  | sed \
333    -e 's!0 0 [1-9].*!CRASHED!' \
334    -e 's!0 0 0!PASSED!' \
335    -e 's!\([0-9]\+\) \([0-9]\+\) .*!TEST FAILED (errors=\1, failures=\2)!'
336  rm -f ${TMP}
337}
338 
339function junit_test() {
340  print_name $1
341  cd ${BUILD}/java
342  res=0
343  case ${OUTPUT} in
344    v) junit_test_v $1 || res=1 ;;
345    q) junit_test_q $1 || res=1 ;;
346    n) junit_test_n $1 || res=1 ;;
347  esac
348  if [ -n "${XML_RES_PATH:-}" ]; then
349    cp "${BUILD}/doc/junit-reports/TESTS-TestSuites.xml" "${XML_RES_PATH}"
350  fi
351  return $res
352}
353
354function junit_test_v() {
355    res=0
356    ant_test $1 2>&1 \
357        | log \
358        || res=1
359    return $res
360}
361
362function junit_test_q() {
363    res=0
364    ant_test $1 2>&1 \
365        | log \
366        | egrep "(\[(jastadd|junit)\]|BUILD FAILED|\[java\] Error when parsing file:)" \
367        | sed -n \
368            -e '1 i\
369                0 0' \
370            -e 's!^.*\[jastadd\] \(Semantic errors\|Syntax error\).*$!BUILD FAILED!' \
371            -e 's!^.*\[java\] Error when parsing file:.*$!BUILD FAILED!' \
372            -e 's!^.*Failures: \([0-9]*\), Errors: \([0-9]*\),.*$!r\1+r\2+!p' \
373            -e 's!^.*\(BUILD FAILED\).*$![\1]pq!p' \
374            -e '$ a\
375                [errors=]nn[, failures=]np' \
376        | dc \
377        | sed \
378            -e 's!errors=0, failures=0!PASSED!' \
379            -e 's!\(errors=.*, failures=.*\)!TEST FAILED (\1)!' \
380        || res=1
381    return $res
382}
383
384function junit_test_n() {
385    res=0
386    ant_test $1 \
387        | log \
388        | egrep "(\[junit\]|\[(java|jastadd)\].*([Ee]rror|[A-Za-z.]*:[1-9][0-9]*))" \
389        || res=1
390    return $res
391}
392
393function nose_test() {
394  nosetests `compute_nose_extra_args "${TEST}"` ${TAGS} -v $1
395}
396
397function ant_test() {
398  if [[ "$1" == "Modelica" ]]; then
399    ant -f ${MC_ANT_ARGS} -Dtarget=${BUILD} ${CLEAN_JUNIT} test
400  else
401    ant -f ${OC_ANT_ARGS} -Dtarget=${BUILD} ${CLEAN_JUNIT} test
402  fi
403}
404
405function build_jmodelica() {
406  if [[ "${NO_BUILD_JMODELICA}" != "1" ]]; then
407    if [[ -d ${BUILD} ]]; then
408      cd ${BUILD}
409      ${CLEAN_BUILD}
410      make && make install
411    else
412      echo Cannot build, build dir does not exist!
413      exit 1
414    fi
415  fi
416}
417
418function switch_test_flags() {
419  STATE=0
420  for a in $*; do
421    if [[ "${test[${!a}]}" != 1 ]]; then
422      STATE=1
423    fi
424  done
425  for a in $*; do
426    test[${!a}]=${STATE}
427  done
428}
429
430function compute_nose_extra_args() { # Argument is test name
431    if [ -n "${XML_RES_PATH:-}" ]; then
432        RES_FILE_NAME=`echo $1 | sed -e 's!^.*jmodelica.!!g' -e 's!/!_!g'`
433        if [[ "$PYTHON64" = 1 ]]; then
434            RES_FILE_NAME="python64_${RES_FILE_NAME}"
435        fi
436        echo --with-xunit --xunit-file=${XML_RES_PATH}/${RES_FILE_NAME}.xml
437    fi
438}
439
440function read_args() {
441  TESTS=
442  TESTS64=
443  ARG_TYPE=flag
444  for a in ${DEFAULT_ARGS} "$@"; do
445    if [[ "$(echo $a | head -c1)" == "-" ]]; then
446      ARG_TYPE=flag
447    fi
448    FLAG=0
449    case ${ARG_TYPE} in
450      flag)
451        FLAG=1
452        ;;
453      tag)
454        TAGS="${TAGS} -a ${a}"
455        ;;
456      tag64)
457        TAGS64="${TAGS64} -a ${a}"
458        ;;
459      file)
460        if [[ -f "${a}" ]]; then
461          FILE="$(readlink -f ${a})"
462        else
463          FILE="${TESTS_DIR}/${a}"
464          FILE64="${TESTS64_DIR}/${a}"
465        fi
466        if [[ -f ${FILE} ]]; then
467          TESTS="${TESTS} ${FILE}"
468        else
469          echo "Cannot find test file ${a}"
470          exit
471        fi
472        if [[ "${PYTHON64_HOME}" != "" ]]; then
473         if [[ -f ${FILE64} ]]; then
474          TESTS64="${TESTS64} ${FILE64}"
475         else
476           echo "Cannot find test file ${a}"
477           exit
478         fi
479        fi
480        ;;
481      xmlResPath)
482        XML_RES_PATH=${a}
483        ARG_TYPE=flag
484        ;;
485    esac
486    if [[ ${FLAG} == 1 ]]; then
487      for b in $(echo "" ${a}|sed 's!\(.\)!\1 !g'); do
488        case ${b} in
489          -)
490            ;;
491          v|q|n)
492            OUTPUT=${b}
493            ;;
494          a|j|m|o|p)
495            test_set="test_set_${b}"
496            switch_test_flags ${!test_set}
497            ;;
498          z)
499            if ! [[ "${PYTHON64_HOME}" != "" ]]; then
500                echo "Python 64 bit tests not supported!"
501                exit
502            fi
503            test_set="test_set_${b}"
504            switch_test_flags ${!test_set}
505            ;;
506          c|C)
507            CLEAN_JUNIT=clean
508            if [[ "${b}" == C ]]; then
509              CLEAN_BUILD="make clean"
510            fi
511            ;;
512          i)
513            NO_BUILD_JMODELICA=1
514            ;;
515          k)
516            KEEP_PYTHON=1
517            ;;
518          l)
519            LOG=$((1-LOG))
520            ;;
521          f)
522            ARG_TYPE=file
523            ;;
524          t)
525            TAGS=""
526            ARG_TYPE=tag
527            ;;
528          u)
529            if ! [[ "${PYTHON64_HOME}" != "" ]]; then
530                echo "Python 64 bit tests not supported!"
531                exit
532            fi
533            TAGS64=""
534            ARG_TYPE=tag64
535            ;;
536          g)
537            if ! [[ "${PYTHON64_HOME}" != "" ]]; then
538                echo "Python 64 bit tests not supported!"
539                exit
540            fi
541            ARG_TYPE=tag
542            ;;
543          r)
544            ARG_TYPE=tag64
545            ;;
546          x)
547            ARG_TYPE=xmlResPath
548            ;;
549          e)
550            ERROR_ON_TEST_FAIL=1
551            ;;
552          h)
553            echo "usage: tests [-ajmopzvnqcCh] { [-(t|u|g|r) [tag1 ...]] } [-f file1 ...] [-x path]"
554            echo "The -ajmopz options each control a set of tests, and select all tests in set "
555            echo "for running, or, if all in set are already selected, deselects them. "
556            echo "Thus, \"tests -am\" runs all tests except modelica. If no tests are chosen, "
557            echo "a default set is run (${DEFAULT_TESTS})." 
558            echo "  -a   Select/deselect all tests"
559            echo "  -j   Select/deselect junit tests"
560            echo "  -m   Select/deselect modelica tests"
561            echo "  -o   Select/deselect optimca tests"
562            echo "  -p   Select/deselect python tests"
563            echo "  -z   Select/deselect python 64 bit tests (not always a valid option)"
564            echo "  -v   Verbose output, show everything"
565            echo "  -n   Normal output, only show results and compilation errors"
566            echo "  -q   Quiet output, only show brief results"
567            echo "  -c   Do a clean before junit tests"
568            echo "  -C   Do a clean before each test suite"
569            echo "  -i   Do not re-build before python tests"
570            echo "  -k   Keep generated files from python tests"
571            echo "  -l   Toggle creating log file with the equivalent of the output with -v" 
572            echo "       (on by default)"
573            echo "  -t   When running python tests, only run tests marked with one of the "
574            echo "       listed tags. If given without tags, all tests are run. If -t is "
575            echo "       given several times, only the last one will be used (not always a valid option)"
576            echo "  -u   When running python64 tests, only run tests marked with one of the "
577            echo "       listed tags. If given without tags, all tests are run. If -u is "
578            echo "       given several times, only the last one will be used"
579            echo "  -g   When running python tests, add the listed tags to the tags to use"
580            echo "  -r   When running python 64tests, add the listed tags to the tags to use"
581            echo "  -f   When running python tests, only run tests from the listed files. "
582            echo "       Paths relative to the tests directory are accepted, as well as "
583            echo "       absolute or relative to current directory"
584            echo "  -x   Path to folder where jUnit like xml files are written. The xml files"
585            echo "       contains the results of the tests. Currently doesn't handle spaces"
586            echo "       in the supplied path!"
587            echo "  -e   When enabled, exit with error code (after running all "
588            echo "       tests) if any test suite return with an error code or a test fails"
589            echo "       regular failures or errors). Default behaviour is exit 0.".
590            echo "       Requires -x".
591            echo "  -h   Print this help and exit"
592            exit
593            ;;
594          *)
595            echo "Unknown flag -${b}"
596            exit
597            ;;
598        esac
599      done
600    fi
601  done
602}
603
604# === Main ===
605OUTPUT=n
606LOGFILE="$(pwd)/tests.log"
607LOG=1
608i=0
609for a in ${tests}; do
610    test[${i}]=0
611    (( ${a}=i++ ))
612done
613export JAVA_HOME JMODELICA_HOME IPOPT_HOME PYTHONPATH LD_LIBRARY_PATH ANT_OPTS SUNDIALS_HOME
614TIME=$(date +%s)
615
616read_args "$@"
617
618if [[ $ERROR_ON_TEST_FAIL == 1 ]]; then
619    if [[ -z $XML_RES_PATH ]]; then
620        echo "-e needs -x"
621        exit 1
622    fi
623fi
624
625if [ "${LOG}" == 1 ]; then
626  echo "Log of jm_tests $(date):" > "${LOGFILE}"
627fi
628
629ANY_ON=0
630for a in ${tests}; do
631  if [[ "${test[${!a}]}" == 1 ]]; then
632    ANY_ON=1
633  fi
634done
635if [[ "${ANY_ON}" == 0 ]]; then
636  switch_test_flags ${DEFAULT_TESTS}
637fi
638
639# If on Windows, inform user about bug in ticket #766
640if [[ ${SYS} == Win ]]; then
641  echo Note: If modelica or optimica tests seem to hang, press enter a couple of times.
642fi
643
644res=0
645for a in ${tests}; do
646  if [[ "${test[${!a}]}" == 1 ]]; then
647    ${a}_tests || res=1
648  fi
649done
650
651if [[ "${OUTPUT}" != q ]]; then
652  echo ========================
653fi
654echo $(date +%s) ${TIME}"-[Total time: ]nd60/n[:]n60%[0n]sxd10>xp" | dc
655
656# Rename test names in xml when run with 64 bit python
657if [ -n "${XML_RES_PATH:-}" ]; then
658    for f in ${XML_RES_PATH}/*; do
659        if [[ "${f}" == *"python64_"* ]]; then
660            sed -e 's#classname=\"#classname=\"python64.#g' $f > temp.xml
661            mv -f temp.xml $f
662        fi
663    done
664fi
665
666if [[ "${ERROR_ON_TEST_FAIL}" == 1 ]]; then
667    if [[ $res == 0 ]]; then
668        grep -R testsuite $XML_RES_PATH | sed -n -e "/.*errors=\"[0]*[1-9][0-9]*\".*/ q1" -e "/.*failures=\"[0]*[1-9][0-9]*\".*/ q1"
669        exit $?
670    fi
671    exit $res
672else
673    exit 0
674fi
Note: See TracBrowser for help on using the repository browser.