diff --git a/.travis.yml b/.travis.yml index 496ecd20b..0cf61d75e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ env: before_install: # install needed deps - travis_retry sudo apt-get update -qq - - travis_retry sudo apt-get install -qq python3-pip qt5-default qt5-qmake qtbase5-dev qtcreator libxml2-utils libpcre3 gdb unzip wx-common xmlstarlet python3-dev liblua5.3-dev libcurl3 libcairo2-dev libsigc++-2.0-dev + - travis_retry sudo apt-get install -qq python3-pip qt5-default qt5-qmake qtbase5-dev qtcreator libxml2-utils libpcre3 gdb unzip wx-common xmlstarlet python3-dev liblua5.3-dev libcurl3 libcairo2-dev libsigc++-2.0-dev tidy # Python 2 modules - travis_retry python2 -m pip install --user pytest==4.6.4 - travis_retry python2 -m pip install --user pylint diff --git a/htmlreport/check.sh b/htmlreport/check.sh index 828999fff..a0cca748b 100755 --- a/htmlreport/check.sh +++ b/htmlreport/check.sh @@ -1,24 +1,54 @@ #!/bin/bash -ex +# Command for checking HTML syntax with HTML Tidy, see http://www.html-tidy.org/ +# newer tidy (5.6.0) command, if using this it is not necessary to ignore warnings: +#tidy_cmd='tidy -o /dev/null -eq --drop-empty-elements no' +# older tidy from 2009 (Ubuntu 16.04 Xenial comes with this old version): +tidy_cmd='tidy -o /dev/null -eq' + +function validate_html { + set +e + ${tidy_cmd} $1 + tidy_status=$? + set -e + if [ $tidy_status -eq 2 ]; then + echo "HTML does not validate!" + exit 1 + fi +} ./cppcheck-htmlreport --file ../gui/test/data/xmlfiles/xmlreport_v2.xml --title "xml2 test" --report-dir . --source-dir ../test/ echo -e "\n" +# Check HTML syntax +validate_html index.html +validate_html stats.html ../cppcheck ../gui/test --enable=all --inconclusive --xml-version=2 2> gui_test.xml xmllint --noout gui_test.xml ./cppcheck-htmlreport --file ./gui_test.xml --title "xml2 + inconclusive test" --report-dir . echo "" +# Check HTML syntax +validate_html index.html +validate_html stats.html + ../cppcheck ../gui/test --enable=all --inconclusive --verbose --xml-version=2 2> gui_test.xml xmllint --noout gui_test.xml ./cppcheck-htmlreport --file ./gui_test.xml --title "xml2 + inconclusive + verbose test" --report-dir . echo -e "\n" +# Check HTML syntax +validate_html index.html +validate_html stats.html ../cppcheck --errorlist --inconclusive --xml-version=2 > errorlist.xml xmllint --noout errorlist.xml ./cppcheck-htmlreport --file ./errorlist.xml --title "errorlist" --report-dir . +# Check HTML syntax +validate_html index.html +validate_html stats.html + ../cppcheck ../samples/memleak/good.c ../samples/resourceLeak/good.c --xml-version=2 --enable=information --suppressions-list=test_suppressions.txt --xml 2> unmatchedSuppr.xml xmllint --noout unmatchedSuppr.xml @@ -27,3 +57,6 @@ grep "unmatchedSuppression<.*>information<.*>Unmatched suppression: variableScop grep ">unmatchedSuppressioninformation<.*>Unmatched suppression: uninitstring<" index.html grep "notexisting" index.html grep ">unmatchedSuppression<.*>information<.*>Unmatched suppression: \*<" index.html +# Check HTML syntax +validate_html index.html +validate_html stats.html diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport index 3c99bfbc0..b854d3c2e 100755 --- a/htmlreport/cppcheck-htmlreport +++ b/htmlreport/cppcheck-htmlreport @@ -90,7 +90,7 @@ div.verbose div.content { margin-top: 5px; text-align: left; width: 150px; - height: 75%; + /*height: 75%;*/ position: fixed; overflow: auto; z-index: 1; @@ -102,7 +102,7 @@ div.verbose div.content { padding-left: 5px; text-align: left; width: 300px; - height: 75%; + /*height: 75%;*/ position: fixed; overflow: auto; z-index: 1; @@ -259,7 +259,7 @@ HTML_FOOTER = """ Internet: http://cppcheck.net IRC: irc://irc.freenode.net/cppcheck -
+