Permalink
Browse files

Travis: Test with specific libusb versions.

Since no USB bus is available in Travis' VMs, the only use is checking
libusb1.py's behaviour on missing symbols.
Use a mirror as libusb.org is down currently.
  • Loading branch information...
1 parent 1e26f5c commit 12546d66f8871b9ec14bd18bee8b3aa86b89c87b @vpelletier committed Apr 20, 2013
Showing with 40 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +7 −0 .travis.yml
  3. +32 −0 buildTestLibusb.sh
View
@@ -0,0 +1 @@
+test-libusb/
View
@@ -7,6 +7,13 @@ python:
before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq libusb-1.0-0
+ - sudo apt-get build-dep -qq libusb-1.0-0
+# - ./buildTestLibusb.sh git://git.libusb.org/libusb.git libusb.git master v1.0.6
+ - ./buildTestLibusb.sh git://repo.or.cz/libusb.git libusb.git master v1.0.6
install:
pip install . --use-mirrors
script: python testUSB1.py
+env:
+ - LD_LIBRARY_PATH=
+ - LD_LIBRARY_PATH=test-libusb/build/libusb.git/master/lib
+ - LD_LIBRARY_PATH=test-libusb/build/libusb.git/v1.0.6/lib
View
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Build several libusb versions to run tests against.
+# Useful to check backward-compatibility with libusb versions which lack some
+# exports.
+if [ $# -lt 3 ]; then
+ echo "Usage: $0 remote remte_name changeset [changeset [...]]"
+ exit 1
+fi
+
+set -e
+
+BASE="$PWD/test-libusb"
+BUILD_BASE="$BASE/build"
+
+REMOTE="$1"
+REMOTE_NAME="$2"
+shift 2
+REPO_DIR="$BASE/repo/$REMOTE_NAME"
+mkdir -p "$REPO_DIR"
+git clone -n "$REMOTE" "$REPO_DIR"
+while [ $# -ne 0 ]; do
+ CHANGESET="$1"
+ shift
+ BUILD_DIR="$BUILD_BASE/$REMOTE_NAME/$CHANGESET"
+ mkdir -p "$BUILD_DIR"
+ cd "$REPO_DIR"
+ git checkout --force "$CHANGESET"
+ git clean --force -dx
+ ./autogen.sh --prefix="$BUILD_DIR"
+ make
+ make install
+done

0 comments on commit 12546d6

Please sign in to comment.