analyze with sonarqube

This commit is contained in:
arvidn 2017-09-08 11:16:31 +02:00 committed by Arvid Norberg
parent 7cc2619aad
commit 9f177ad413
3 changed files with 39 additions and 8 deletions

View File

@ -4,6 +4,7 @@ dist: trusty
matrix:
fast_finish: true
include:
- env: variant=test_debug sonar_scan=1 toolset=gcc
- env: variant=test_debug lint=1 tests=1 toolset=gcc-sanitizer
- env: variant=test_debug sim=1 crypto=openssl toolset=gcc-sanitizer
- env: variant=test_release coverage=1 tests=1 toolset=gcc-coverage python=1
@ -108,6 +109,14 @@ install:
- if [ "$docs" == "1" ]; then /Users/travis/Library/Python/2.7/bin/rst2html.py --version; fi
- 'if [ "$lint" == "1" ]; then curl "https://raw.githubusercontent.com/google/styleguide/71ec7f1e524969c19ce33cfc72e8e023f2b98ee2/cpplint/cpplint.py" >~/cpplint.py; fi'
- 'if [ $sonar_scan == "1" ]; then
wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.6.1.zip;
wget https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip;
unzip sonar-scanner-2.6.1.zip;
unzip build-wrapper-linux-x86.zip;
export PATH=$PWD/sonar-scanner-2.6.1/bin:$PWD/build-wrapper-linux-x86:$PATH;
fi'
- ccache -V
- ccache --show-stats
- ccache --zero-stats
@ -141,6 +150,11 @@ script:
python ~/cpplint.py --extensions=cpp --headers=hpp --filter=-,+runtime/explicit,+whitespace/end_of_line --linelength=90 test/*.{cpp,hpp} src/*.cpp include/libtorrent/*.hpp include/libtorrent/kademlia/*.hpp src/kademlia/*.cpp include/libtorrent/aux_/*.hpp include/libtorrent/extensions/*.hpp simulation/*.{cpp,hpp} tools/*.{cpp,hpp} examples/*.{cpp,hpp};
fi'
- 'if [ "$sonar_scan" == "1" ]; then
build-wrapper-linux-x86-64 --out-dir bw-output bjam -j3 crypto=$crypto asserts=off invariant-checks=full $toolset variant=$variant -l300 &&
sonar-scanner -D sonar.login=$SONAR_TOKEN;
fi'
# if we are building with code coverage, report it as soon as possible
# libtorrent is the name of the test suite target
- cd test

17
sonar-project.properties Normal file
View File

@ -0,0 +1,17 @@
# must be unique in a given SonarQube instance
sonar.projectKey=libtorrent
sonar.organization=arvidn-github
sonar.cfamily.build-wrapper-output=bw-output
sonar.host.url=https://sonarcloud.io
# this is the name and version displayed in the SonarQube UI. Was mandatory
# prior to SonarQube 6.1.
sonar.projectName=libtorrent
sonar.projectVersion=1.2
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on
# Windows.
# This property is optional if sonar.modules is set.
sonar.sources=.

View File

@ -589,14 +589,14 @@ TORRENT_TEST(invalid_chunk_afl)
0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d, // Cont-Length: 20
0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x2d, 0x4c, 0x65, // Contente: tn
0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x32, 0x30, // Transfer-Encoding: chunked
0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, //
0x74, 0x65, 0x3a, 0x20, 0x74, 0x6e, 0x0d, 0x0a, //
0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, //
0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, // -89abc9abcdef
0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, 0x6e, 0x6b, // <20>
0x65, 0x64, 0x0d, 0x0a, 0x0d, 0x0d, 0x0a, 0x0d, // T<><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>def
0x0a, 0x0a, 0x2d, 0x38, 0x39, 0x61, 0x62, 0x63, // <20>
0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x0d, // T<><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>est-headyr: foobar
0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x65, 0x3a, 0x20, 0x74, 0x6e, 0x0d, 0x0a,
0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72,
0x2d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e,
0x67, 0x3a, 0x20, 0x63, 0x68, 0x75, 0x6e, 0x6b,
0x65, 0x64, 0x0d, 0x0a, 0x0d, 0x0d, 0x0a, 0x0d,
0x0a, 0x0a, 0x2d, 0x38, 0x39, 0x61, 0x62, 0x63,
0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x0d,
0x0a, 0xd6, 0x0d, 0x0a, 0x54, 0xbd, 0xbd, 0xbd,
0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0x64,
0x65, 0x66, 0x0d, 0x0a, 0xd6, 0x0d, 0x0a, 0x54,