Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,24 @@ env:
- SEQUENCEPARSER_BUILD=${TRAVIS_BUILD_DIR}/build-sequenceparser
- SEQUENCEPARSER_INSTALL=${TRAVIS_BUILD_DIR}/install-sequenceparser
- CI_NODE_TOTAL=2
matrix:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.4

# This results in a 2×2 build matrix.
# Where the variables are: os / compiler
# This results in a 2×2x2 build matrix.
# Where the variables are: os / compiler / python version

addons:
apt:
sources: ['boost-latest', 'kalakris-cmake']
sources: ['boost-latest', 'kalakris-cmake', 'pythonxy-devel']
packages:
- cmake
- swig
- libboost1.55-all-dev
- python-dev
- python-nose
- python3-dev
- python3-nose

cache:
# Caching Ubuntu packages
Expand All @@ -41,13 +46,5 @@ before_script:
- uname -a

script:
# build
- mkdir ${SEQUENCEPARSER_BUILD} && cd ${SEQUENCEPARSER_BUILD}
- cmake .. -DCMAKE_INSTALL_PREFIX=${SEQUENCEPARSER_INSTALL} -DSEQUENCEPARSER_PYTHON_VERSION=2.7
- make
- make install

# tests
- cd ${TRAVIS_BUILD_DIR}
- export PYTHONPATH=$PYTHONPATH:${SEQUENCEPARSER_INSTALL}/lib/python2.7/site-packages
- nosetests pyTest
- tools/travis/build.sh
- tools/travis/launch_tests.sh
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if(SWIG_FOUND)
set_source_files_properties(${SEQUENCEPARSER_BINDING_FILE} PROPERTIES CPLUSPLUS ON)

# Swig flags
set(CMAKE_SWIG_FLAGS -c++ -fcompact -small -O -Wall)
set(COMMON_SWIG_FLAGS -c++ -fcompact -small -O -Wall)

### PYTHON BINDING
find_package(PythonLibs ${SEQUENCEPARSER_PYTHON_VERSION})
Expand All @@ -56,7 +56,7 @@ if(SWIG_FOUND)

# Swig flags
if(${PYTHONLIBS_VERSION_STRING} VERSION_GREATER "3")
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -py3)
set(CMAKE_SWIG_FLAGS ${COMMON_SWIG_FLAGS} -py3)
endif()

# Create '_sequenceparser' shared lib (python)
Expand Down Expand Up @@ -103,7 +103,7 @@ if(SWIG_FOUND)
include_directories(${JNI_INCLUDE_DIRS})

# Swig flags
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -package org.sequenceparser)
set(CMAKE_SWIG_FLAGS ${COMMON_SWIG_FLAGS} -package org.sequenceparser)

# Create 'sequenceparser-java' shared lib
swig_add_module(sequenceparser-java java ${SEQUENCEPARSER_BINDING_FILE})
Expand Down
2 changes: 1 addition & 1 deletion src/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define SEQUENCEPARSER_VERSION_MAJOR 1
#define SEQUENCEPARSER_VERSION_MINOR 2
#define SEQUENCEPARSER_VERSION_MICRO 0
#define SEQUENCEPARSER_VERSION_MICRO 1

#include <string>
#include <cstddef>
Expand Down
17 changes: 17 additions & 0 deletions tools/travis/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Exit immediately if a command exits with a non-zero status
set -e
# Print commands and their arguments as they are executed.
set -x

# Create directory of build
mkdir ${SEQUENCEPARSER_BUILD}
cd ${SEQUENCEPARSER_BUILD}

# Build sequenceParser
cmake --version
cmake .. -DCMAKE_INSTALL_PREFIX=${SEQUENCEPARSER_INSTALL} -DSEQUENCEPARSER_PYTHON_VERSION=${PYTHON_VERSION}
make -k
make install
cd ..
16 changes: 16 additions & 0 deletions tools/travis/launch_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Exit immediately if a command exits with a non-zero status
set -e
# Print commands and their arguments as they are executed.
set -x

# set env
export PYTHONPATH=$PYTHONPATH:${SEQUENCEPARSER_INSTALL}/lib/python${PYTHON_VERSION}/site-packages

# nosetests
if [[ ${PYTHON_VERSION} == "2.7" ]]; then
nosetests ${TRAVIS_BUILD_DIR}/pyTest -v
elif [[ ${PYTHON_VERSION} == "3.4" ]]; then
nosetests3 ${TRAVIS_BUILD_DIR}/pyTest -v
fi