Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Support for cross-Python testing #71

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
97f4270
Issue #42: excluded current branch from CI tests
dzhoshkun Oct 28, 2018
a0c2aa6
Issue #42: added new stages that will possibly replace existing ones …
dzhoshkun Oct 28, 2018
6d1f396
Issue #42: added a blank tox.ini file
dzhoshkun Oct 28, 2018
0b40451
Issue #42: added a basic tox script with py27 env
dzhoshkun Oct 28, 2018
e00721d
Issue #42: added a basic CI section running tox
dzhoshkun Oct 28, 2018
cdd3112
Issue #42: added a skipsdist clause to tox
dzhoshkun Oct 28, 2018
767c634
Issue #42: added a py35 env to tox
dzhoshkun Oct 28, 2018
c9f8729
Issue #42: using generic name for CI section
dzhoshkun Oct 28, 2018
af4094b
Issue #42: passing source and scratch dir envvars to tox
dzhoshkun Oct 28, 2018
cfa86b3
Issue #42: whitelisting echo command in tox
dzhoshkun Oct 28, 2018
c3a3f20
Issue #42: fixed use of tox syntax to access envvars
dzhoshkun Oct 28, 2018
2d0404b
Issue #42: composing a custom build dir associated with envname in tox
dzhoshkun Oct 28, 2018
11c510a
Issue #42: making a temp build dir and changing into it
dzhoshkun Oct 28, 2018
916f2d2
Issue #42: using tox changedir to change to custom build dir
dzhoshkun Oct 28, 2018
99ac1fe
Issue #42: specified pytest as a dep in tox
dzhoshkun Oct 28, 2018
c0375a4
Issue #42: added a bare-bones build section to tox
dzhoshkun Oct 28, 2018
1b96040
Issue #42: whitelisted make and cmake
dzhoshkun Oct 28, 2018
d8e1319
Issue #42: calling exit_on_fail on a separate line to avoid confusing…
dzhoshkun Oct 28, 2018
4d767ec
Issue #42: whitelisted exit_on_fail command
dzhoshkun Oct 28, 2018
cbc676a
Issue #42: removed exit_on_fail call after make
dzhoshkun Oct 28, 2018
570d7f5
Issue #42: printing pytest version for testing
dzhoshkun Oct 28, 2018
30d27a7
Revert "Issue #42: printing pytest version for testing"
dzhoshkun Oct 28, 2018
73df4db
Issue #42: copied CI script up to HEVC support to see if ctest works
dzhoshkun Oct 28, 2018
2c2f14d
Issue #42: added the rest of linux CI script to tox
dzhoshkun Oct 28, 2018
4e14c7f
Revert "Issue #42: using generic name for CI section"
dzhoshkun Oct 28, 2018
edfc224
Issue #42: running only py27 environment
dzhoshkun Oct 28, 2018
cfe38c4
Issue #42: added a py35 tox running section to CI script
dzhoshkun Oct 28, 2018
ee8ca6e
Issue #42: using Boost built against Python 3.5 for py35 tox call
dzhoshkun Oct 28, 2018
f7f9500
Issue #42: using explicit Boost root set in CI script to keep tox cal…
dzhoshkun Oct 28, 2018
bf183f3
Issue #42: using empty envvar for Boost root when using default in to…
dzhoshkun Oct 28, 2018
ae0a706
Issue #42: removed unneeded print statements from tox config
dzhoshkun Oct 28, 2018
570b556
Issue #42: added a numpy dep to tox config
dzhoshkun Oct 28, 2018
4e10df8
Issue #42: added a numpy dep to tox config
dzhoshkun Oct 28, 2018
f52d495
Issue #42: quick hack to see whether the libvpx problem is related to…
dzhoshkun Oct 28, 2018
ba5db58
Issue #42: using Boost-only installation directory for Python 3-compa…
dzhoshkun Oct 28, 2018
3aea2d0
Revert "Issue #42: quick hack to see whether the libvpx problem is re…
dzhoshkun Oct 28, 2018
10b06b6
Issue #42: removed hard-coded Python version string from CMake config
dzhoshkun Nov 8, 2018
94f3ed5
Issue #42: custom Boost.Python discovery based on Python version
dzhoshkun Nov 8, 2018
e60623f
Issue #42: forcing particular Python versions in tests
dzhoshkun Nov 8, 2018
f9894f2
Issue #42: using explicit bytes conversion for strings
dzhoshkun Nov 8, 2018
421efb9
Issue #42: using Python version suffix for discovering relevant Boost…
dzhoshkun Nov 8, 2018
8838580
Issue #42: rearranged PYTHONPATH setting of tests to force use of lib…
dzhoshkun Nov 8, 2018
6296ba0
Issue #50: upgraded minimum required CMake version to 3.12.4
dzhoshkun Nov 8, 2018
368e838
Issue #50: forcing use of CMake 3.12.4 in CI script
dzhoshkun Nov 8, 2018
198922f
Issue #50: fixed BOOST_ROOT in CI script
dzhoshkun Nov 9, 2018
1af4b6b
Issue #50: passing BOOST_ROOT explicitly to CMake to force use of spe…
dzhoshkun Nov 9, 2018
1216401
Issue #50: workaround to linker flags-related issue caused by pkg-config
dzhoshkun Nov 9, 2018
69e694d
Issue #50: uppercase for CMake logical operator
dzhoshkun Nov 9, 2018
ffcf476
Issue #42: moved tox.ini to ci folder
dzhoshkun Nov 12, 2018
92d186f
Issue #42: added a pip installer bundling step before_script
dzhoshkun Nov 12, 2018
ea5d2eb
Issue #42: added dummy tox config for pip installer
dzhoshkun Nov 12, 2018
e6daecb
Issue #42: added pip installer test sections to CI using new tox config
dzhoshkun Nov 12, 2018
ef7af32
Issue #42: removed unused directive from tox config
dzhoshkun Nov 12, 2018
fcdc2aa
Issue #42: copied all pip installer tests to pip tox file
dzhoshkun Nov 17, 2018
14722e0
Issue #42: disabled pip installer fail check in tox
dzhoshkun Nov 17, 2018
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
59 changes: 59 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ variables:
CTEST_OUTPUT_ON_FAILURE: "1"

before_script:
- export GiftGrab_REPO_DIR=$(pwd)
- export REVHASH=$(git rev-parse --short HEAD)
- export SCRATCH_DIR="$SCRATCH_DIR/$REVHASH"
- mkdir -p $SCRATCH_DIR
Expand All @@ -12,12 +13,68 @@ before_script:
- export TEST_LAUNCHER="${GiftGrab_SOURCE_DIR}/tests/run-tests.sh"
- source "$CI_SCRIPTS_DIR/utils.sh"
- export BOOST_163_ROOT_DIR="/home/gitlab-runner/environments/giftgrab/boost163"
# force use of CMake version 3.12.4 (issue #50)
- export CMAKE_3_12_4_PATH="/home/gitlab-runner/environments/giftgrab/install/cmake/cmake-3.12.4-Linux-x86_64/bin"
- export PATH="$CMAKE_3_12_4_PATH:$PATH"
# create pip installer
- export GiftGrab_PIP_INSTALLER_DIR="$SCRATCH_DIR/pip-installer"
- rm -rf "$GiftGrab_PIP_INSTALLER_DIR"
- mkdir -p "$GiftGrab_PIP_INSTALLER_DIR"
- cd "$GiftGrab_SOURCE_DIR"
- python setup.py sdist
- export GiftGrab_PIP_INSTALLER="$(ls dist | grep tar.gz)"
- if [ -z "$GiftGrab_PIP_INSTALLER" ]; then exit 1; fi
- mv dist/${GiftGrab_PIP_INSTALLER} "$GiftGrab_PIP_INSTALLER_DIR"
- export GiftGrab_PIP_INSTALLER="${GiftGrab_PIP_INSTALLER_DIR}/${GiftGrab_PIP_INSTALLER}"
- unset GiftGrab_PIP_INSTALLER_DIR
- cd "$GiftGrab_REPO_DIR"
# test launcher
- export GiftGrab_TEST_LAUNCHER=${GiftGrab_SOURCE_DIR}/tests/run-tests.sh

stages:
- offline
- device-cmake
- device-pip
- install
- test_cmake
- test_pypi

build-py27:
stage: offline
script:
- export BOOST_ROOT="" # otherwise tox complains!
# force use of Python 2.7 libs
- sed -i 's:PythonLibs REQUIRED:PythonLibs 2.7 REQUIRED:g' src/cmake/pythonlibs/CMakeLists.txt
- tox -c ci/build.tox.ini -e py27
tags:
- gift-adelie

build-py35:
stage: offline
script:
- export BOOST_ROOT="/home/gitlab-runner/environments/giftgrab/install/boost"
# force use of Python 3 libs
- sed -i 's:PythonLibs REQUIRED:PythonLibs 3 REQUIRED:g' src/cmake/pythonlibs/CMakeLists.txt
- tox -c ci/build.tox.ini -e py35
tags:
- gift-adelie

pip-py27:
stage: offline
script:
- export BOOST_ROOT="" # otherwise tox complains!
- tox -c ci/pip.tox.ini -e py27
tags:
- gift-adelie

pip-py35:
stage: offline
script:
- export BOOST_ROOT="/home/gitlab-runner/environments/giftgrab/install/boost"
- tox -c ci/pip.tox.ini -e py35
tags:
- gift-adelie

################## Platform: CMake ##################
################## Target: All ######################
linux:
Expand Down Expand Up @@ -109,6 +166,7 @@ linux:
- 224-add-a-citing-gift-grab-section-to-pypi-page
- 225-add-citing-gift-grab-section-to-rtd-index
- 223-add-some-information-on-the-main-doxygen-home-page
- 42-support-for-cross-python-testing

################## Platform: PyPI ##################
################## Target: All #####################
Expand Down Expand Up @@ -208,6 +266,7 @@ pypi:
- 222-add-how-to-cite-block-in-main-readme
- 225-add-citing-gift-grab-section-to-rtd-index
- 223-add-some-information-on-the-main-doxygen-home-page
- 42-support-for-cross-python-testing

################## Device: Epiphan DVI2PCIe Duo ##################
################## Platform: PyPI ################################
Expand Down
79 changes: 79 additions & 0 deletions ci/build.tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[tox]
envlist = py27,py35
skipsdist = True

[testenv]
whitelist_externals =
echo
cmake
make
ctest
passenv =
GiftGrab_SOURCE_DIR
SCRATCH_DIR
BOOST_ROOT
setenv =
GiftGrab_BUILD_DIR = {env:SCRATCH_DIR}/build/{envname}
INSTALL_DIR = {env:SCRATCH_DIR}/install/{envname}
changedir = {env:GiftGrab_BUILD_DIR}
deps =
pytest
numpy
scipy
commands =
; bare-bones build
cmake -D CMAKE_INSTALL_PREFIX={env:INSTALL_DIR} {env:GiftGrab_SOURCE_DIR}
make -j
; no ctest: no features activated to be tested yet
make install
; Python and tests (currently all python)
cmake -D BOOST_ROOT={env:BOOST_ROOT} -D BUILD_PYTHON=ON -D BUILD_TESTS=ON .
make -j
; no ctest: no features activated to be tested yet
make install
; HEVC support
cmake -D USE_HEVC=ON .
make -j
ctest
make install
; HEVC support with x265
cmake -D ENABLE_GPL=ON -D USE_X265=ON .
make -j
ctest
make install
; turn x265 off explicitly for combination testing
cmake -D ENABLE_GPL=OFF -D USE_X265=OFF .
; hardware-accelerated HEVC
cmake -D ENABLE_NONFREE=ON -D USE_NVENC=ON .
make -j
ctest
make install
; Xvid support (OpenCV should get switched here)
cmake -D USE_XVID=ON .
make -j
ctest
make install
; VP9 support
cmake -D USE_VP9=ON .
make -j
; not executing VP9 tests due to issue #189
ctest -E Test_VP9
make install
; NumPy support
cmake -D USE_NUMPY=ON .
make -j
; not executing VP9 tests due to issue #189
ctest -E Test_VP9
make install
; test support for video files
cmake -D USE_FILES=ON .
make -j
; not executing VP9 tests due to issue #189
ctest -E Test_VP9
make install
; build docs
cmake -D BUILD_DOC=ON .
make -j
; no ctest: only checking whether doc building
; properly here
make install
65 changes: 65 additions & 0 deletions ci/pip.tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[tox]
envlist = py27,py35
skipsdist = True

[testenv]
whitelist_externals =
echo
passenv =
GiftGrab_PIP_INSTALLER
SCRATCH_DIR
BOOST_ROOT
GiftGrab_TEST_LAUNCHER
deps =
pytest
numpy
scipy
commands =
# TODO: fail check disabled until we find a way
# to do this in tox
# pip install {env:GiftGrab_PIP_INSTALLER}
# HEVC support
pip install -vvv --install-option="--hevc" --upgrade {env:GiftGrab_PIP_INSTALLER}
{env:GiftGrab_TEST_LAUNCHER} encode hevc bgra
# HEVC support with x265
pip install -vvv --install-option="--hevc" --install-option="--enable-gpl" --install-option="--x265" --upgrade {env:GiftGrab_PIP_INSTALLER}
{env:GiftGrab_TEST_LAUNCHER} encode hevc bgra
{env:GiftGrab_TEST_LAUNCHER} encode hevc i420
# hardware-accelerated HEVC
pip install -vvv --install-option="--hevc" --install-option="--enable-nonfree" --install-option="--nvenc" --upgrade {env:GiftGrab_PIP_INSTALLER}
{env:GiftGrab_TEST_LAUNCHER} encode hevc bgra
{env:GiftGrab_TEST_LAUNCHER} encode hevc i420
# Xvid support
pip install -vvv --install-option="--hevc" --install-option="--enable-nonfree" --install-option="--nvenc" --install-option="--xvid" --upgrade {env:GiftGrab_PIP_INSTALLER}
{env:GiftGrab_TEST_LAUNCHER} encode xvid bgra
# VP9 support
pip install -vvv --install-option="--hevc" --install-option="--enable-nonfree" --install-option="--nvenc" --install-option="--xvid" --install-option="--vp9" --upgrade {env:GiftGrab_PIP_INSTALLER}
# not executing VP9 tests due to issue #189
# {env:GiftGrab_TEST_LAUNCHER} encode vp9 bgra
# {env:GiftGrab_TEST_LAUNCHER} encode vp9 i420
# NumPy support
pip install -vvv --install-option="--hevc" --install-option="--enable-nonfree" --install-option="--nvenc" --install-option="--xvid" --install-option="--vp9" --install-option="--numpy" --upgrade {env:GiftGrab_PIP_INSTALLER}
# TODO: delete these five lines after issue #133
{env:GiftGrab_TEST_LAUNCHER} encode hevc bgra
{env:GiftGrab_TEST_LAUNCHER} encode hevc i420
{env:GiftGrab_TEST_LAUNCHER} encode xvid bgra
# not executing VP9 tests due to issue #189
# {env:GiftGrab_TEST_LAUNCHER} encode vp9 bgra
# {env:GiftGrab_TEST_LAUNCHER} encode vp9 i420
# Run the actual NumPy tests
pip install numpy
{env:GiftGrab_TEST_LAUNCHER} numpy bgra
{env:GiftGrab_TEST_LAUNCHER} numpy i420
# test support for video files
pip install -vvv --install-option="--hevc" --install-option="--enable-nonfree" --install-option="--nvenc" --install-option="--xvid" --install-option="--vp9" --install-option="--numpy" --install-option="--files" --upgrade {env:GiftGrab_PIP_INSTALLER}
{env:GiftGrab_TEST_LAUNCHER} decode hevc bgra
{env:GiftGrab_TEST_LAUNCHER} decode hevc i420
{env:GiftGrab_TEST_LAUNCHER} decode hevc uyvy
{env:GiftGrab_TEST_LAUNCHER} decode xvid bgra
{env:GiftGrab_TEST_LAUNCHER} decode xvid i420
{env:GiftGrab_TEST_LAUNCHER} decode xvid uyvy
# not executing VP9 tests due to issue #189
# {env:GiftGrab_TEST_LAUNCHER} decode vp9 bgra
# {env:GiftGrab_TEST_LAUNCHER} decode vp9 i420
# {env:GiftGrab_TEST_LAUNCHER} decode vp9 uyvy

2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT(GiftGrab)
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

# Will be used when installing
SET(GiftGrab_PATH_SUFFIX giftgrab)
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/blackmagicsdk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

if(NOT DEFINED ENV{BlackmagicSDK_DIR})
MESSAGE(FATAL_ERROR
Expand Down
26 changes: 23 additions & 3 deletions src/cmake/boost.python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

SET(GG_BOOST_COMPONENTS python)
if(NOT PYTHONLIBS_VERSION_STRING)
MESSAGE(FATAL_ERROR "Could not determine Python version")
endif()
if(PYTHONLIBS_VERSION_STRING MATCHES ^3\.*)
SET(GG_BOOST_PYTHON_SUFFIX 3)
elseif(PYTHONLIBS_VERSION_STRING MATCHES ^2\.7\.*)
SET(GG_BOOST_PYTHON_SUFFIX "")
else()
MESSAGE(FATAL_ERROR "Found unsupported Python version ${PYTHONLIBS_VERSION_STRING}")
endif()

SET(GG_BOOST_COMPONENTS python${GG_BOOST_PYTHON_SUFFIX})
if(USE_NUMPY)
LIST(APPEND GG_BOOST_COMPONENTS numpy)
if(BOOST_ROOT AND GG_BOOST_PYTHON_SUFFIX)
# The following line is a workaround to a problem related to issue #50.
# In the case of specifying a custom Boost via e.g. BOOST_ROOT on a system
# with another (global) Boost installation, pkg-config's linker flags lead
# to the implicit discovery of the system-wide Boost.Python (version 2!)
# library, which gets linked into GIFT-Grab and causes conflicts with the
# specified Boost installation
LIST(APPEND GG_BOOST_COMPONENTS python)
endif()
LIST(APPEND GG_BOOST_COMPONENTS numpy${GG_BOOST_PYTHON_SUFFIX})
endif(USE_NUMPY)
FIND_PACKAGE(Boost COMPONENTS ${GG_BOOST_COMPONENTS} REQUIRED)
SET(Boost_INCLUDE_DIR ${Boost_INCLUDE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/cpp11/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

# C++11
INCLUDE(CheckCXXCompilerFlag)
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/epiphansdk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

if(NOT DEFINED ENV{EpiphanSDK_DIR})
MESSAGE(FATAL_ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/ffmpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

# Augment module path to be able to find needed packages
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/libvlc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

# Augment module path to be able to find needed packages
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/opencv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

FIND_PACKAGE(OpenCV REQUIRED)
SET(OpenCV_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS}
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

# Unsupported platforms
if(APPLE)
Expand Down
7 changes: 5 additions & 2 deletions src/cmake/pythonlibs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.4)

FIND_PACKAGE(PythonLibs 2.7 REQUIRED)
FIND_PACKAGE(PythonLibs REQUIRED)
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}
CACHE INTERNAL "PythonLibs include dirs"
)
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARIES}
CACHE INTERNAL "PythonLibs libraries"
)
SET(PYTHONLIBS_VERSION_STRING ${PYTHONLIBS_VERSION_STRING}
CACHE INTERNAL "PythonLibs version string"
)
13 changes: 9 additions & 4 deletions src/python/modules/giftgrab/utils/inspection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from subprocess import check_output


equals_char = b'='
slash_char = b'/'
double_quote_char = b'"'


def frame_rate(file_path):
"""Use ``ffprobe`` to inspect frame rate of video file

Expand All @@ -16,7 +21,7 @@ def frame_rate(file_path):
'-of', 'flat=s=_',
'-show_entries', 'stream=r_frame_rate',
file_path])
frame_rate_str = ffprobe_output.split('=')[1].strip()[1:-1].split('/')
frame_rate_str = ffprobe_output.split(equals_char)[1].strip()[1:-1].split(slash_char)
fr = -1
if len(frame_rate_str) == 1:
fr = float(frame_rate_str[0])
Expand Down Expand Up @@ -62,7 +67,7 @@ def duration(file_path):
'-of', 'flat=s=_',
'-show_entries', 'format=duration',
file_path])
duration_str = ffprobe_output.split('=')[1].strip()[1:-1]
duration_str = ffprobe_output.split(equals_char)[1].strip()[1:-1]
dur = -1
if duration_str is not None:
dur = float(duration_str)
Expand Down Expand Up @@ -97,7 +102,7 @@ def resolution(file_path):
res = []
for ffprobe_command in ffprobe_commands:
ffprobe_output = check_output(ffprobe_command)
resolution_str = ffprobe_output.split('=')[1].strip()
resolution_str = ffprobe_output.split(equals_char)[1].strip()
if resolution_str is not None:
res.append(float(resolution_str))
else:
Expand All @@ -123,7 +128,7 @@ def codec(file_path):
'-of', 'flat=s=_',
'-show_entries', 'stream=codec_name',
file_path])
codec_str = ffprobe_output.split('=')[1].strip().strip('"')
codec_str = ffprobe_output.split(equals_char)[1].strip().strip(double_quote_char)
if codec_str is not None:
return codec_str
else:
Expand Down
4 changes: 2 additions & 2 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# to avoid copying stuff around
SET(PYTHONPATH "${CMAKE_BINARY_DIR}:$ENV{PYTHONPATH}")
SET(PYTHONPATH "${CMAKE_SOURCE_DIR}/tests:$ENV{PYTHONPATH}")
SET(PYTHONPATH "${CMAKE_SOURCE_DIR}/python/modules:${PYTHONPATH}")
SET(PYTHONPATH "${CMAKE_SOURCE_DIR}/tests:${PYTHONPATH}")
SET(PYTHONPATH "${CMAKE_BINARY_DIR}:${PYTHONPATH}")

# Obtain Catch header for testing
SET(CATCH_DIR "${CMAKE_BINARY_DIR}/extern/Catch")
Expand Down