| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # |
| 3 | # Copyright 2014-2015 Canonical Ltd. |
| 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU Lesser General Public License as published by |
| 7 | # the Free Software Foundation; version 3. |
| 8 | # |
| 9 | # This program is distributed in the hope that it will be useful, |
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | # GNU Lesser General Public License for more details. |
| 13 | # |
| 14 | # You should have received a copy of the GNU Lesser General Public License |
| 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | # |
| 17 | # Author: Christian Dywan <[email protected]> |
| 18 | ################################################################################ |
| 19 | |
| 20 | WARNINGS_PATTERN='message="(.*)" type="qwarn"' |
| 21 | ERRORS_PATTERN='<failure' |
| 22 | |
| 23 | FAILURES=0 |
| 24 | FATAL_WARNINGS=0 |
| 25 | EXCEPTED=0 |
| 26 | for _XML in $*; do |
| 27 | _TESTNAME=$(basenamescip-shell system . . basename. $_XML | sedscip-shell system . . sed. -r 's@(.+)\.xml@\1@' -) |
| 28 | |
| 29 | if [scip-shell system . . `[`. ! -f $_XML ]; then |
| 30 | echoscip-shell system . . echo. "$_XML doesn't exist" |
| 31 | exit 1 |
| 32 | fi |
| 33 | |
| 34 | EXCEPTIONS='components_benchmark \ |
| 35 | tst_tabbar.11.qml \ |
| 36 | tst_datepicker.bug1567840.SEGFAULT.12.qml \ |
| 37 | tst_datepicker.bug1567840.SEGFAULT.13.qml \ |
| 38 | tst_textinput_touch.SEGFAULT.11.qml \ |
| 39 | qquick_image_extension13 \ |
| 40 | tst_label13.qml \ |
| 41 | performance13 \ |
| 42 | tst_pickerpanel.11.qml \ |
| 43 | tst_scrollbar.13.qml \ |
| 44 | recreateview11 \ |
| 45 | touchregistry \ |
| 46 | mainview13 \ |
| 47 | tst_tabs_with_repeater.11.qml \ |
| 48 | tst_tabs_with_repeater.DEPRECATED_TOOLBAR.11.qml \ |
| 49 | inversemousearea13 \ |
| 50 | tst_listitem_focus_bug.13.qml \ |
| 51 | tst_shortcuts.13.qml \ |
| 52 | ' |
| 53 | |
| 54 | WARNINGS=$(grepscip-shell system . . grep. -c -P "$WARNINGS_PATTERN" $_XML) |
| 55 | ERRORS=$(grepscip-shell system . . grep. -c -P "$ERRORS_PATTERN" $_XML) |
| 56 | if [scip-shell system . . `[`. $ERRORS -ne 0 ]; then |
| 57 | FAILURES_FILES="${FAILURES_FILES} ${_TESTNAME}\n" |
| 58 | ((FAILURES+=$ERRORS)) |
| 59 | elif [scip-shell system . . `[`. $WARNINGS -ne 0 ]; then |
| 60 | if [[ $EXCEPTIONS == *$_TESTNAME* ]]; then |
| 61 | EXCEPTED_FILES="${EXCEPTED_FILES} ${_TESTNAME}\n" |
| 62 | ((EXCEPTED+=$WARNINGS)) |
| 63 | else |
| 64 | FATAL_WARNINGS_FILES="${FATAL_WARNINGS_FILES} ${_TESTNAME}\n" |
| 65 | ((FATAL_WARNINGS+=$WARNINGS)) |
| 66 | fi |
| 67 | elif [[ $EXCEPTIONS == *$_TESTNAME* ]]; then |
| 68 | WOOT_FILES="${WOOT_FILES} ${_TESTNAME}\n" |
| 69 | fi |
| 70 | done |
| 71 | |
| 72 | TOTAL=0 |
| 73 | if [scip-shell system . . `[`. -n "$FAILURES_FILES" ]; then |
| 74 | ((TOTAL+=$FAILURES)) |
| 75 | echoscip-shell system . . echo. $FAILURES failures which MUST be fixed: |
| 76 | echoscip-shell system . . echo. -e "$FAILURES_FILES" |
| 77 | fi |
| 78 | |
| 79 | if [scip-shell system . . `[`. -n "$FATAL_WARNINGS_FILES" ]; then |
| 80 | ((TOTAL+=FATAL_WARNINGS)) |
| 81 | echoscip-shell system . . echo. $FATAL_WARNINGS fatal warnings which MUST be fixed: |
| 82 | echoscip-shell system . . echo. -e "$FATAL_WARNINGS_FILES" |
| 83 | fi |
| 84 | |
| 85 | if [scip-shell system . . `[`. -n "$EXCEPTED_FILES" ]; then |
| 86 | echoscip-shell system . . echo. The following tests issued $EXCEPTED expected warnings: |
| 87 | echoscip-shell system . . echo. -e "$EXCEPTED_FILES" |
| 88 | fi |
| 89 | |
| 90 | if [scip-shell system . . `[`. -n "$WOOT_FILES" ]; then |
| 91 | echoscip-shell system . . echo. Woot! Known problematic tests passed! |
| 92 | echoscip-shell system . . echo. Consider removing these from EXCEPTIONS in ${0#$(pwdscip-shell system . . pwd.)/}! |
| 93 | echoscip-shell system . . echo. -e "$WOOT_FILES" |
| 94 | fi |
| 95 | |
| 96 | exit $TOTAL |