From 50d8f342fe31e299f4120851b02d4c65be3abd66 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 2 Aug 2014 15:03:40 +0200 Subject: realize freebsd build compatibility Add definition of IUCLC. Fix build with boost 1.42.0, that provides the boost filesystem api v2 only. --- src/SerialTty.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/gant/antlib.c | 4 ++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/SerialTty.cpp b/src/SerialTty.cpp index 5fe98b9..6612909 100644 --- a/src/SerialTty.cpp +++ b/src/SerialTty.cpp @@ -33,14 +33,18 @@ #include #include #include -#include +#include +#include #include #include "Log.hpp" #include "common.hpp" #include "DeviceSettings.hpp" +#ifndef IUCLC +# define IUCLC 0 +#endif namespace fs = boost::filesystem; using namespace std; @@ -89,10 +93,56 @@ find_file_starts_with(const fs::path & dir, for( fs::directory_iterator dir_iter(dir) ; dir_iter != end_iter ; ++dir_iter) { fs::path p = *dir_iter; +/// from http://www.boost.org/doc/libs/1_49_0/libs/filesystem/v2/doc/index.htm + +/// Version 3, a major revision with many new and improved features, +/// is also available. Version 3 may break some user code written for +/// Version 2. + +// To ease the transition, Boost releases 1.44 through 1.47 will +// supply both V2 and V3. Version 2 is the default version for Boost +// release 1.44 and 1.45. Version 3 will be the default starting with +// release 1.46. + +// Define macro BOOST_FILESYSTEM_VERSION as 3 to use Version 3. This +// will be the default for release 1.46 and later. + +// Define macro BOOST_FILESYSTEM_VERSION as 2 to use Version 2. This +// is the default for release 1.44 and 1.45. + +// You may define the BOOST_FILESYSTEM_VERSION macro: + + +// On the build command line; the exact format depends on your +// compiler or IDE + + +// In your code, before including any filesystem header, #define +// BOOST_FILESYSTEM_VERSION n + + +// #define BOOST_FILESYSTEM_VERSION n in boost/config/user.hpp. Note +// #that this approach applies to all uses of Boost.Filesystem. + +// Existing code should be moved to version 3 as soon as +// convenient. New code should be written for version 3. + +// Version 2 is deprecated, and will not be included in Boost releases +// 1.48 and later. + +#if (((BOOST_VERSION/100000)==1) && (((BOOST_VERSION / 100) % 1000)<44)) // BOOST_FILESYSTEM_VERSION==2 + if(std::string(p.leaf()).find(start)==0) + { + return std::string(p.leaf()); + } +#elif BOOST_FILESYSTEM_VERSION==3 if(p.leaf().string().find(start)==0) { return p.leaf().string(); } +#else +# error "Unsupported boost filesystem version" ##BOOST_FILESYSTEM_VERSION +#endif } return ""; } diff --git a/src/gant/antlib.c b/src/gant/antlib.c index 8b3c58d..e879b8d 100644 --- a/src/gant/antlib.c +++ b/src/gant/antlib.c @@ -28,6 +28,10 @@ #define MAXCHAN 32 #define BSIZE 8*10000 +#ifndef IUCLC +# define IUCLC 0 +#endif + #define uchar unsigned char #define hexval(c) ((c >= '0' && c <= '9') ? (c-'0') : ((c&0xdf)-'A'+10)) -- cgit v1.2.3 From 7ee26dd0ea991e6d3f73f8654d8c4159c2499675 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 2 Aug 2014 17:05:48 +0200 Subject: docs: update maintainer notes --- docs/maintainer.txt | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/docs/maintainer.txt b/docs/maintainer.txt index e0ad785..b92d6a5 100644 --- a/docs/maintainer.txt +++ b/docs/maintainer.txt @@ -122,7 +122,51 @@ apt-get source bc pbuilder build *.dsc ** building the actual package +rm cmake-build git reset --hard HEAD +git clean -f -X +git clean -f -d pristine-tar checkout antpm_1.14.orig.tar.gz mv antpm_1.14.orig.tar.gz .. -git-pbuilder -us -uc +DIST=sid ARCH=i386 git-pbuilder -us -uc + +** managing patches on top of the package with quilt +* http://pkg-perl.alioth.debian.org/howto/quilt.html +*** Creating a Patch +To create a patch, run quilt new $patch_name. If you want .patch +extension, you need to give it explicitly. +This creates a new patch entry in debian/patches. This patch also +becomes the topmost or current patch. This is the patch that is at the +top of the stack. +Now choose what file you want to change in that patch and run quilt +edit $file. quilt notes the current state of the file and launches +your $EDITOR so you can edit the file. +Repeat the quilt edit command for every file you want to be changed by +that patch. +When you're finished, run quilt refresh. This compares the noted state +of the edited files with their present state, and produces a patch in +debian/patches. +Note that this patch is currently applied. Check it with quilt +applied. +If the package is already being maintained in the pkg-perl Git +repository, it is necessary to tell Git that you have added new +files. You can do this with git add debian/patches ; git commit. + +***Applying and Unapplying Patches +Now that we have the patch applied, let's play with it. quilt pop +unapplies the topmost patch. quilt push applies the next patch in the +series. You may see the list of unapplied patches with quilt +unapplied. + +***Editing Patches +To edit a patch, you have to first make it current (be on the top of +the stack of applied patches). If the patch is already applied (but +not the top), run quilt pop $patch_name; if it is not, run quilt push +$patch_name. Now that the patch is on the top of the stack, run quilt +edit $file as before. You can edit files that were already in the +patch and you can edit new files. When you're done, remember to tell +this to quilt by running quilt refresh. + +***Other Commands +quilt delete deletes, quilt rename renames a patch. There are a lot +more. See the manual page. -- cgit v1.2.3 From de8a0ad59432f8c716de3a8189a1b538224324a3 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 2 Aug 2014 17:09:33 +0200 Subject: docs: update maintainer notes --- docs/maintainer.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/maintainer.txt b/docs/maintainer.txt index b92d6a5..177b037 100644 --- a/docs/maintainer.txt +++ b/docs/maintainer.txt @@ -128,6 +128,7 @@ git clean -f -X git clean -f -d pristine-tar checkout antpm_1.14.orig.tar.gz mv antpm_1.14.orig.tar.gz .. +DIST=sid ARCH=i386 git-pbuilder --update DIST=sid ARCH=i386 git-pbuilder -us -uc ** managing patches on top of the package with quilt -- cgit v1.2.3 From 6da5fa529bb226d12966aeaaa6d2ee92f6469f28 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 14:48:57 +0200 Subject: docs: more packaging details --- docs/maintainer.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/maintainer.txt b/docs/maintainer.txt index b92d6a5..19c51cb 100644 --- a/docs/maintainer.txt +++ b/docs/maintainer.txt @@ -122,12 +122,13 @@ apt-get source bc pbuilder build *.dsc ** building the actual package -rm cmake-build +rm -r cmake-build git reset --hard HEAD git clean -f -X git clean -f -d pristine-tar checkout antpm_1.14.orig.tar.gz mv antpm_1.14.orig.tar.gz .. +DIST=sid ARCH=i386 git-pbuilder --update DIST=sid ARCH=i386 git-pbuilder -us -uc ** managing patches on top of the package with quilt -- cgit v1.2.3 From c28b49fc00c4d8a823b204c2607bf1d2b727c250 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:24:08 +0200 Subject: cmake: link against boost_atomic too --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be34cd9..282ad65 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,7 +68,7 @@ ELSE() ENDIF() set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) -FIND_PACKAGE(Boost 1.41.0 COMPONENTS thread unit_test_framework program_options system filesystem date_time REQUIRED) +FIND_PACKAGE(Boost 1.41.0 COMPONENTS thread unit_test_framework program_options system filesystem date_time atomic REQUIRED) IF(NOT Boost_FOUND) MESSAGE(FATAL_ERROR "Boost not found!") ENDIF() -- cgit v1.2.3 From 43bb2f387c650309ba54fe01c781ee65b595502a Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:33:39 +0200 Subject: debian: libboost-atomic-dev is required --- scripts/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/debian/control b/scripts/debian/control index 24929a7..bbd6d3e 100644 --- a/scripts/debian/control +++ b/scripts/debian/control @@ -3,7 +3,7 @@ Maintainer: Kristof Ralovich Section: misc Priority: optional Standards-Version: 3.9.4 -Build-Depends: debhelper (>= 8), devscripts (>= 2.10), g++ (>= 4.4) | clang (>= 3.0), libboost-dev (>= 1.41) | libboost1.41-dev, cmake (>= 2.8), libusb-dev, libxml2-dev, pkg-config (>= 0.25), libboost-thread-dev,libboost-filesystem-dev,libboost-system-dev,libboost-date-time-dev,libboost-program-options-dev,libboost-test-dev +Build-Depends: debhelper (>= 8), devscripts (>= 2.10), g++ (>= 4.4) | clang (>= 3.0), libboost-dev (>= 1.41) | libboost1.41-dev, cmake (>= 2.8), libusb-dev, libxml2-dev, pkg-config (>= 0.25), libboost-thread-dev,libboost-filesystem-dev,libboost-system-dev,libboost-date-time-dev,libboost-program-options-dev,libboost-test-dev,libboost-atomic-dev Homepage: https://code.google.com/p/antpm/ Vcs-Git: https://code.google.com/p/antpm/ Vcs-Browser: https://code.google.com/p/antpm/source/browse/ -- cgit v1.2.3 From ef3a57c026ddb8f93ada2b2dc5a3c6a06a3b717b Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:36:17 +0200 Subject: travis-ci: need libboost-atomic-dev --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6acfd2f..a1a0111 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: - cat /proc/cpuinfo - g++ -v - clang++ -v -install: sudo apt-get install libboost-dev libboost-date-time-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libusb-dev libxml2-dev valgrind +install: sudo apt-get install libboost-dev libboost-date-time-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-atomic-dev libusb-dev libxml2-dev valgrind before_script: mkdir cmake-build script: - cd cmake-build -- cgit v1.2.3 From c0dcb7e119cc846f07ff57431a1abc804d329c01 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:46:36 +0200 Subject: travis-ci: refine coverity setup --- .travis.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1a0111..96018cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,18 @@ +env: + global: + - secure: "NA10+myP2uSLPi0OTDp9/tPWpX25UW1afZtL0cutaaEwY2kO/Q+sBZr2GgcHLNk8uOP5l+7uOsisPYVhD7qXjrNyjrUdtW80YdKEQ8IQDqAgX6xz+80OnMyjXSM4dlDfGyieH6JFEYkEpKnWqdMLJASQwgBCkm03Ow1jeMDwxvQ=" + +addons: + coverity_scan: + project: + name: "ralovich/antpm" + description: "ANT+minus Build submitted via Travis CI" + notification_email: ralovich@in.tum.de + build_command_prepend: "mkdir cmake-build && cd cmake-build && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" + build_command: "make -j 4" + branch_pattern: coverity_scan + build_script_url: "https://raw.githubusercontent.com/ralovich/antpm/master/scripts/coverity_scan_script.sh" + language: cpp script: cmake compiler: @@ -6,7 +21,7 @@ compiler: notifications: email: recipients: - - tade60@freemail.hu + - ralovich@in.tum.de on_success: always on_failure: always branches: @@ -29,17 +44,3 @@ script: - cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make -j4 && make test ARGS=-j99 - make clean -env: - global: - - secure: "TwkmQpkzvrzW58QB9igH+8wATcWSyW+oWkWKUkCfjjZ4zEz5WA8v1CGk3/ABA1EllvdCxcMXwvP66A8NKQYET79lQxPXBK+l9GtC2gco4M3wZ5afW+5BCnsTehQLzKqM+2CK7Zlab7RKQ4g9/X8XTjrD5gN3rmVkgz2+dNKZ/N0=" - -addons: - coverity_scan: - project: - name: "ralovich/antpm" - description: "Build submitted via Travis CI" - notification_email: ralovich@in.tum.de - build_command_prepend: "mkdir cmake-build && cd cmake-build && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" - build_command: "make -j4" - branch_pattern: coverity_scan - -- cgit v1.2.3 From 57a1019004dbf4ecc5cabe4e7ebdf894905b9e24 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:48:07 +0200 Subject: travis-ci: add coverity script --- scripts/coverity_scan_script.sh | 100 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 scripts/coverity_scan_script.sh diff --git a/scripts/coverity_scan_script.sh b/scripts/coverity_scan_script.sh new file mode 100755 index 0000000..f85c3d5 --- /dev/null +++ b/scripts/coverity_scan_script.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +set -e + +# Environment check +echo -e "\033[33;1mNote: PROJECT_NAME and COVERITY_SCAN_TOKEN are available on Project Settings page on scan.coverity.com\033[0m" +[ -z "$COVERITY_SCAN_PROJECT_NAME" ] && echo "ERROR: COVERITY_SCAN_PROJECT_NAME must be set" && exit 1 +#[ -z "$COVERITY_SCAN_NOTIFICATION_EMAIL" ] && echo "ERROR: COVERITY_SCAN_NOTIFICATION_EMAIL must be set" && exit 1 +[ -z "$COVERITY_SCAN_BRANCH_PATTERN" ] && echo "ERROR: COVERITY_SCAN_BRANCH_PATTERN must be set" && exit 1 +[ -z "$COVERITY_SCAN_BUILD_COMMAND" ] && echo "ERROR: COVERITY_SCAN_BUILD_COMMAND must be set" && exit 1 +[ -z "$COVERITY_SCAN_TOKEN" ] && echo "ERROR: COVERITY_SCAN_TOKEN must be set" && exit 1 + +PLATFORM=`uname` +TOOL_ARCHIVE=/tmp/cov-analysis-${PLATFORM}.tgz +TOOL_URL=https://scan.coverity.com/download/${PLATFORM} +TOOL_BASE=/tmp/coverity-scan-analysis +UPLOAD_URL="https://scan.coverity.com/builds" +SCAN_URL="https://scan.coverity.com" + +# Do not run on pull requests +if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then + echo -e "\033[33;1mINFO: Skipping Coverity Analysis: branch is a pull request.\033[0m" + exit 0 +fi + +# Verify this branch should run +IS_COVERITY_SCAN_BRANCH=`ruby -e "puts '${TRAVIS_BRANCH}' =~ /\\A$COVERITY_SCAN_BRANCH_PATTERN\\z/ ? 1 : 0"` +if [ "$IS_COVERITY_SCAN_BRANCH" = "1" ]; then + echo -e "\033[33;1mCoverity Scan configured to run on branch ${TRAVIS_BRANCH}\033[0m" +else + echo -e "\033[33;1mCoverity Scan NOT configured to run on branch ${TRAVIS_BRANCH}\033[0m" + exit 1 +fi + +# Verify upload is permitted +AUTH_RES=`curl -s --form project="$COVERITY_SCAN_PROJECT_NAME" --form token="$COVERITY_SCAN_TOKEN" $SCAN_URL/api/upload_permitted` +if [ "$AUTH_RES" = "Access denied" ]; then + echo -e "\033[33;1mCoverity Scan API access denied. Check COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN.\033[0m" + exit 1 +else + AUTH=`echo $AUTH_RES | ruby -e "require 'rubygems'; require 'json'; puts JSON[STDIN.read]['upload_permitted']"` + if [ "$AUTH" = "true" ]; then + echo -e "\033[33;1mCoverity Scan analysis authorized per quota.\033[0m" + else + WHEN=`echo $AUTH_RES | ruby -e "require 'rubygems'; require 'json'; puts JSON[STDIN.read]['next_upload_permitted_at']"` + echo -e "\033[33;1mCoverity Scan analysis NOT authorized until $WHEN.\033[0m" + exit 1 + fi +fi + +if [ ! -d $TOOL_BASE ]; then + # Download Coverity Scan Analysis Tool + if [ ! -e $TOOL_ARCHIVE ]; then + echo -e "\033[33;1mDownloading Coverity Scan Analysis Tool...\033[0m" + wget -nv -O $TOOL_ARCHIVE $TOOL_URL --post-data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN" + fi + + # Extract Coverity Scan Analysis Tool + echo -e "\033[33;1mExtracting Coverity Scan Analysis Tool...\033[0m" + mkdir -p $TOOL_BASE + pushd $TOOL_BASE + tar xzf $TOOL_ARCHIVE + popd +fi + +TOOL_DIR=`find $TOOL_BASE -type d -name 'cov-analysis*'` +export PATH=$TOOL_DIR/bin:$PATH + +# Build +echo -e "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m" +COV_BUILD_OPTIONS="" +#COV_BUILD_OPTIONS="--return-emit-failures 8 --parse-error-threshold 85" +RESULTS_DIR="cov-int" +eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" +COVERITY_UNSUPPORTED=1 cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND +cov-import-scm --dir $RESULTS_DIR --scm git --log $RESULTS_DIR/scm_log.txt 2>&1 + +# Upload results +echo -e "\033[33;1mTarring Coverity Scan Analysis results...\033[0m" +RESULTS_ARCHIVE=analysis-results.tgz +tar czf $RESULTS_ARCHIVE $RESULTS_DIR +SHA=`git rev-parse --short HEAD` + +echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m" +response=$(curl \ + --silent --write-out "\n%{http_code}\n" \ + --form project=$COVERITY_SCAN_PROJECT_NAME \ + --form token=$COVERITY_SCAN_TOKEN \ + --form email=$COVERITY_SCAN_NOTIFICATION_EMAIL \ + --form file=@$RESULTS_ARCHIVE \ + --form version=$SHA \ + --form description="Travis CI build" \ + $UPLOAD_URL) +status_code=$(echo "$response" | sed -n '$p') +if [ "$status_code" != "201" ]; then + TEXT=$(echo "$response" | sed '$d') + echo -e "\033[33;1mCoverity Scan upload failed: $TEXT.\033[0m" + # changed the following + exit 1 +fi -- cgit v1.2.3 From 45dbdd54e1e6bf243c66fdd0ec71a0c37bb6f479 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:56:45 +0200 Subject: travis-ci: doesn't have libboost-atomic-dev --- .travis.yml | 2 +- src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 96018cc..d0d976a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ before_install: - cat /proc/cpuinfo - g++ -v - clang++ -v -install: sudo apt-get install libboost-dev libboost-date-time-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-atomic-dev libusb-dev libxml2-dev valgrind +install: sudo apt-get install libboost-dev libboost-date-time-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libusb-dev libxml2-dev valgrind before_script: mkdir cmake-build script: - cd cmake-build diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 282ad65..be34cd9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,7 +68,7 @@ ELSE() ENDIF() set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) -FIND_PACKAGE(Boost 1.41.0 COMPONENTS thread unit_test_framework program_options system filesystem date_time atomic REQUIRED) +FIND_PACKAGE(Boost 1.41.0 COMPONENTS thread unit_test_framework program_options system filesystem date_time REQUIRED) IF(NOT Boost_FOUND) MESSAGE(FATAL_ERROR "Boost not found!") ENDIF() -- cgit v1.2.3 From 92bf05718ba0cc27444a38f2683dbb1d0a296f20 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 15:59:38 +0200 Subject: travis-ci: coverity update --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d0d976a..3bc7c05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ env: global: - - secure: "NA10+myP2uSLPi0OTDp9/tPWpX25UW1afZtL0cutaaEwY2kO/Q+sBZr2GgcHLNk8uOP5l+7uOsisPYVhD7qXjrNyjrUdtW80YdKEQ8IQDqAgX6xz+80OnMyjXSM4dlDfGyieH6JFEYkEpKnWqdMLJASQwgBCkm03Ow1jeMDwxvQ=" + - secure: "DT/lVSxqaBtcgGtXy7of+OoRBtOv4xNI3id1MK0V/XT0FTGJQ5+KWFEZ1vPpViIeSjNNjOkDH9d2j3EtahdzAEeFMb8GdZhKqQcXoS7pl2m6seXqvaYOV/HfgHJ9Y08mROdqOeDzEn7t4CH1Fz9WgHy7W1ulCh4i+yQ1qJOSblU=" addons: coverity_scan: -- cgit v1.2.3 From 2e3d05b3c9e30a083c8392a35015b5450c0b832f Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 16:00:58 +0200 Subject: docs: fix line endings --- docs/PROTOCOL_HELP.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/PROTOCOL_HELP.txt b/docs/PROTOCOL_HELP.txt index d773726..0c09178 100644 --- a/docs/PROTOCOL_HELP.txt +++ b/docs/PROTOCOL_HELP.txt @@ -6,22 +6,22 @@ 1) Install VirtualBox on linux, including proprietary oracle usb extensions from www.virtualbox.org. The Open Source edition in the distribution does not support USB. -2) Install win xp with service pack 3 in vbox, set up usb filter to pass through all devices +2) Install win xp with service pack 3 in vbox, set up usb filter to pass through all devices 3) Install garmin's ant agent in virtual xp, but do not start it! -4) Plug in your USB2ANT stick to the host, make sure the cp210x driver didn't grab it, by unloading cp210x kernel module: "rmmod cp210x". +4) Plug in your USB2ANT stick to the host, make sure the cp210x driver didn't grab it, by unloading cp210x kernel module: "rmmod cp210x". 5) Make sure usbmon kernel driver is loaded on the host: "modprobe usbmon" 6) Under linux host, figure out usb bus address of your USB2ANT stick: "lsusb" (e.g.: "Bus 005 Device 001: ID 1d6b:0001 USB2ANT ..." means our bus number is 5) -7) We need to increase usbmon lower threshold for message truncation to say 100 characters. For this build the usbmon tool: - # git clone https://code.google.com/p/antpm/ - # cd antpm/3rd_party/usbmon-6/ - # make +7) We need to increase usbmon lower threshold for message truncation to say 100 characters. For this build the usbmon tool: + # git clone https://code.google.com/p/antpm/ + # cd antpm/3rd_party/usbmon-6/ + # make -8) Start capturing usb traffic under linux host: "./usbmon -i -fu -s 100 > ~/ant-usb-log-001.usbmon" +8) Start capturing usb traffic under linux host: "./usbmon -i -fu -s 100 > ~/ant-usb-log-001.usbmon" 9) Start garmin's ant agent in virtual xp. Once the download is done, quit ant agent. Also terminate the above "cat" process. The dump of your usb communication is now saved to ~/ant-usb-log-001.usbmon. -- cgit v1.2.3 From 112b92869e7a544ad6abe9f9cbe5f0f0ffb4a5b8 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 16:19:16 +0200 Subject: travis-ci: refine coverity setup --- .travis.yml | 93 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bc7c05..fcb3faf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,47 @@ -env: - global: - - secure: "DT/lVSxqaBtcgGtXy7of+OoRBtOv4xNI3id1MK0V/XT0FTGJQ5+KWFEZ1vPpViIeSjNNjOkDH9d2j3EtahdzAEeFMb8GdZhKqQcXoS7pl2m6seXqvaYOV/HfgHJ9Y08mROdqOeDzEn7t4CH1Fz9WgHy7W1ulCh4i+yQ1qJOSblU=" - -addons: - coverity_scan: - project: - name: "ralovich/antpm" - description: "ANT+minus Build submitted via Travis CI" - notification_email: ralovich@in.tum.de - build_command_prepend: "mkdir cmake-build && cd cmake-build && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" - build_command: "make -j 4" - branch_pattern: coverity_scan - build_script_url: "https://raw.githubusercontent.com/ralovich/antpm/master/scripts/coverity_scan_script.sh" - -language: cpp -script: cmake -compiler: - - clang - - gcc -notifications: - email: - recipients: - - ralovich@in.tum.de - on_success: always - on_failure: always -branches: - only: - - master - - coverity_scan -before_install: - - sudo apt-get update - - uname -a - - free - - cat /proc/cpuinfo - - g++ -v - - clang++ -v -install: sudo apt-get install libboost-dev libboost-date-time-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libusb-dev libxml2-dev valgrind -before_script: mkdir cmake-build -script: - - cd cmake-build - - cmake ../src -DCMAKE_BUILD_TYPE=Release -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make -j4 && make test ARGS=-j99 - - make clean - - cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make -j4 && make test ARGS=-j99 - - make clean - +# -*- coding: iso-8859-2-unix -*- +env: + global: + - secure: "WbQ15ePbGMTZQ6Dcbfn2yQ+D3Y/oLJoHhD2dPnzkRdk8/fXoY2VkGBUtgNi9hGm0Cd9kXDicBSEJarxt2NeDEu97VL92ltoicNgJbPNawshIfh1SVCd+tJsI9cBl8OLNCcOu90pK8WubWKcDFTHajAUTpdEujq1NnoyJ57Oynmc=" + +addons: + coverity_scan: + project: + name: "ralovich/antpm" + description: "ANT+minus Build submitted via Travis CI" + notification_email: ralovich@in.tum.de + build_command_prepend: "cd cmake-build && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" + build_command: "make -j 4" + branch_pattern: coverity_scan + build_script_url: "https://raw.githubusercontent.com/ralovich/antpm/master/scripts/coverity_scan_script.sh" + +language: cpp +script: cmake +compiler: + - clang + - gcc +notifications: + email: + recipients: + - ralovich@in.tum.de + on_success: always + on_failure: always +branches: + only: + - master + - coverity_scan +before_install: + - sudo apt-get update + - uname -a + - free + - cat /proc/cpuinfo + - g++ -v + - clang++ -v +install: sudo apt-get install libboost-dev libboost-date-time-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libusb-dev libxml2-dev valgrind +before_script: mkdir cmake-build +script: + - cd cmake-build + - cmake ../src -DCMAKE_BUILD_TYPE=Release -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make -j4 && make test ARGS=-j99 + - make clean + - cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make -j4 && make test ARGS=-j99 + - make clean + -- cgit v1.2.3 From 573883166a6a47fbe6da3e474a48aeb1014e4460 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 19:03:36 +0200 Subject: travis-ci: refining coverity --- .travis.yml | 2 +- scripts/coverity_scan_script.sh | 5 +++-- scripts/do_cov.sh | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 scripts/do_cov.sh diff --git a/.travis.yml b/.travis.yml index fcb3faf..ab17e96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ addons: name: "ralovich/antpm" description: "ANT+minus Build submitted via Travis CI" notification_email: ralovich@in.tum.de - build_command_prepend: "cd cmake-build && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" + build_command_prepend: "pwd && cd cmake-build && pwd && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" build_command: "make -j 4" branch_pattern: coverity_scan build_script_url: "https://raw.githubusercontent.com/ralovich/antpm/master/scripts/coverity_scan_script.sh" diff --git a/scripts/coverity_scan_script.sh b/scripts/coverity_scan_script.sh index f85c3d5..401f55b 100755 --- a/scripts/coverity_scan_script.sh +++ b/scripts/coverity_scan_script.sh @@ -59,15 +59,16 @@ if [ ! -d $TOOL_BASE ]; then echo -e "\033[33;1mExtracting Coverity Scan Analysis Tool...\033[0m" mkdir -p $TOOL_BASE pushd $TOOL_BASE - tar xzf $TOOL_ARCHIVE + tar xzvf $TOOL_ARCHIVE popd fi TOOL_DIR=`find $TOOL_BASE -type d -name 'cov-analysis*'` export PATH=$TOOL_DIR/bin:$PATH +echo $PATH # Build -echo -e "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m" +echo -e "\033[33;1mRunning Coverity Scan Analysis Tool....\033[0m" COV_BUILD_OPTIONS="" #COV_BUILD_OPTIONS="--return-emit-failures 8 --parse-error-threshold 85" RESULTS_DIR="cov-int" diff --git a/scripts/do_cov.sh b/scripts/do_cov.sh new file mode 100755 index 0000000..416aebf --- /dev/null +++ b/scripts/do_cov.sh @@ -0,0 +1,8 @@ + +PATH=~/bin/cov/cov-analysis-linux64-7.5.0/bin:$PATH + +mkdir build-cov +(cd build-cov && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE) +(cd build-cov && cov-build --dir cov-int make -j 4) + + -- cgit v1.2.3 From d08bf29c93f61520ed0984c6a04683d84cd0c038 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 19:16:09 +0200 Subject: travis-ci: refining coverity --- scripts/coverity_scan_script.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/coverity_scan_script.sh b/scripts/coverity_scan_script.sh index 401f55b..b645739 100755 --- a/scripts/coverity_scan_script.sh +++ b/scripts/coverity_scan_script.sh @@ -72,14 +72,25 @@ echo -e "\033[33;1mRunning Coverity Scan Analysis Tool....\033[0m" COV_BUILD_OPTIONS="" #COV_BUILD_OPTIONS="--return-emit-failures 8 --parse-error-threshold 85" RESULTS_DIR="cov-int" +pwd eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" +pwd COVERITY_UNSUPPORTED=1 cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND +echo "++++++++++++++++++++++++++++++" +tail $RESULTS_DIR/build-log.txt +echo "++++++++++++++++++++++++++++++" +pwd +cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND +echo "++++++++++++++++++++++++++++++" +tail $RESULTS_DIR/build-log.txt +echo "++++++++++++++++++++++++++++++" +pwd cov-import-scm --dir $RESULTS_DIR --scm git --log $RESULTS_DIR/scm_log.txt 2>&1 # Upload results echo -e "\033[33;1mTarring Coverity Scan Analysis results...\033[0m" RESULTS_ARCHIVE=analysis-results.tgz -tar czf $RESULTS_ARCHIVE $RESULTS_DIR +tar czvf $RESULTS_ARCHIVE $RESULTS_DIR SHA=`git rev-parse --short HEAD` echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m" -- cgit v1.2.3 From 98705448fe8dcf42022d88993dea3a180e6ce9e1 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 19:18:12 +0200 Subject: travis-ci: refine coverity setup --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ab17e96..3ce41fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ # -*- coding: iso-8859-2-unix -*- env: global: - - secure: "WbQ15ePbGMTZQ6Dcbfn2yQ+D3Y/oLJoHhD2dPnzkRdk8/fXoY2VkGBUtgNi9hGm0Cd9kXDicBSEJarxt2NeDEu97VL92ltoicNgJbPNawshIfh1SVCd+tJsI9cBl8OLNCcOu90pK8WubWKcDFTHajAUTpdEujq1NnoyJ57Oynmc=" + - secure: "DF3a8vcQ7iU7AA4Ons5Ct05G/nhvr7bM8hYHd9B7x7h9tzaGJUgnESXCqiejtoR72fR626iGRXpD/O3h0pvj3OS9IywkuUXaNetnse8/xGZ+aKX+w7Dzvrrg8Q/07xazoR6cIzNJ/FyWWoKoY71gIMRHeOx5pebHyRkIxxFbUIw=" addons: coverity_scan: -- cgit v1.2.3 From f8b57e68586505af4ef38a6ff5d35b2fd1ad5f48 Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristof" Date: Sat, 9 Aug 2014 19:30:35 +0200 Subject: travis-ci: refine coverity setup --- .travis.yml | 2 +- scripts/coverity_scan_script.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ce41fe..921dc6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ addons: name: "ralovich/antpm" description: "ANT+minus Build submitted via Travis CI" notification_email: ralovich@in.tum.de - build_command_prepend: "pwd && cd cmake-build && pwd && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE -DCMAKE_INSTALL_PREFIX=/usr && make clean" + build_command_prepend: "pwd && cd cmake-build && pwd && cmake ../src -DCMAKE_BUILD_TYPE=Debug -DUSE_BOOST_TEST=TRUE" build_command: "make -j 4" branch_pattern: coverity_scan build_script_url: "https://raw.githubusercontent.com/ralovich/antpm/master/scripts/coverity_scan_script.sh" diff --git a/scripts/coverity_scan_script.sh b/scripts/coverity_scan_script.sh index b645739..23429d6 100755 --- a/scripts/coverity_scan_script.sh +++ b/scripts/coverity_scan_script.sh @@ -59,7 +59,7 @@ if [ ! -d $TOOL_BASE ]; then echo -e "\033[33;1mExtracting Coverity Scan Analysis Tool...\033[0m" mkdir -p $TOOL_BASE pushd $TOOL_BASE - tar xzvf $TOOL_ARCHIVE + tar xzf $TOOL_ARCHIVE popd fi @@ -73,16 +73,19 @@ COV_BUILD_OPTIONS="" #COV_BUILD_OPTIONS="--return-emit-failures 8 --parse-error-threshold 85" RESULTS_DIR="cov-int" pwd +echo "COVERITY_SCAN_BUILD_COMMAND_PREPEND=${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" eval "${COVERITY_SCAN_BUILD_COMMAND_PREPEND}" pwd +ls -las +echo "CB=cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND" COVERITY_UNSUPPORTED=1 cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND echo "++++++++++++++++++++++++++++++" -tail $RESULTS_DIR/build-log.txt +cat $RESULTS_DIR/build-log.txt echo "++++++++++++++++++++++++++++++" pwd cov-build --dir $RESULTS_DIR $COV_BUILD_OPTIONS $COVERITY_SCAN_BUILD_COMMAND echo "++++++++++++++++++++++++++++++" -tail $RESULTS_DIR/build-log.txt +cat $RESULTS_DIR/build-log.txt echo "++++++++++++++++++++++++++++++" pwd cov-import-scm --dir $RESULTS_DIR --scm git --log $RESULTS_DIR/scm_log.txt 2>&1 @@ -93,6 +96,8 @@ RESULTS_ARCHIVE=analysis-results.tgz tar czvf $RESULTS_ARCHIVE $RESULTS_DIR SHA=`git rev-parse --short HEAD` +exit 0 + echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m" response=$(curl \ --silent --write-out "\n%{http_code}\n" \ -- cgit v1.2.3