Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into effect-parenting
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennoCaldato committed Apr 21, 2021
2 parents 0b8481f + 0e1b8d6 commit 4d9d6ec
Show file tree
Hide file tree
Showing 21 changed files with 180 additions and 455 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -32,7 +32,7 @@ jobs:
sudo apt update
sudo apt install \
cmake swig doxygen graphviz curl lcov \
libopenshot-audio-dev \
libopenshot-audio-dev libasound2-dev \
qtbase5-dev qtbase5-dev-tools \
libfdk-aac-dev libavcodec-dev libavformat-dev libavdevice-dev libavutil-dev libavfilter-dev libswscale-dev libpostproc-dev libswresample-dev \
libzmq3-dev libmagick++-dev \
Expand Down
44 changes: 20 additions & 24 deletions .gitlab-ci.yml
Expand Up @@ -71,19 +71,17 @@ windows-builder-x64:
- try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
- if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/develop/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
- Expand-Archive -Path artifacts.zip -DestinationPath .
- $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x64"
- $env:UNITTEST_DIR = "C:\msys64\usr"
- $env:RESVGDIR = "C:\msys64\usr"
- $env:Path = "C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\usr\lib\cmake\UnitTest++;C:\msys64\home\jonathan\depot_tools;C:\msys64\usr;C:\msys64\usr\lib;C:\msys64\usr\local\x64\mingw\bin;C:\msys64\usr\local;" + $env:Path;
- New-Item -ItemType Directory -Force -Path build
- cd build
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x64" -D"PYTHON_MODULE_PATH=python" -D"RUBY_MODULE_PATH=ruby" -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -D"CMAKE_BUILD_TYPE:STRING=Release" ../
- mingw32-make install
- $PROJECT_VERSION = (Select-String -Path "../CMakeLists.txt" -Pattern '^set\(PROJECT_VERSION_FULL "(.*)\"' | %{$_.Matches.Groups[1].value})
- $PROJECT_SO = (Select-String -Path "../CMakeLists.txt" -Pattern '^set\(PROJECT_SO_VERSION (.*)\)' | %{$_.Matches.Groups[1].value})
- New-Item -path "install-x64/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$CI_PIPELINE_ID`nVERSION:$PROJECT_VERSION`nSO:$PROJECT_SO" -ItemType file -force
- $env:Path = "C:\msys64\mingw64\bin;C:\msys64\usr\bin;C:\msys64\usr\local\bin;" + $env:Path;
- $env:MSYSTEM = "MINGW64"
- cmake -B build -S . -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x64" -D"OpenShotAudio_ROOT=$CI_PROJECT_DIR\build\install-x64" -D"PYTHON_MODULE_PATH=python" -D"RUBY_MODULE_PATH=ruby" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release"
- cmake --build build
- cmake --build build --target coverage
- cmake --install build
- $PROJECT_VERSION = (Select-String -Path "CMakeLists.txt" -Pattern '^set\(PROJECT_VERSION_FULL "(.*)\"' | %{$_.Matches.Groups[1].value})
- $PROJECT_SO = (Select-String -Path "CMakeLists.txt" -Pattern '^set\(PROJECT_SO_VERSION (.*)\)' | %{$_.Matches.Groups[1].value})
- New-Item -path "build/install-x64/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$CI_PIPELINE_ID`nVERSION:$PROJECT_VERSION`nSO:$PROJECT_SO" -ItemType file -force
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x64/share/$CI_PROJECT_NAME.log"
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
when: always
except:
- tags
Expand All @@ -100,19 +98,17 @@ windows-builder-x86:
- try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
- if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot-audio/-/jobs/artifacts/develop/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
- Expand-Archive -Path artifacts.zip -DestinationPath .
- $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x86"
- $env:UNITTEST_DIR = "C:\msys32\usr"
- $env:RESVGDIR = "C:\msys32\usr"
- $env:Path = "C:\msys32\mingw32\bin;C:\msys32\mingw32\lib;C:\msys32\usr\lib\cmake\UnitTest++;C:\msys32\home\jonathan\depot_tools;C:\msys32\usr;C:\msys32\usr\lib;C:\msys32\usr\local\x64\mingw\bin;C:\msys32\usr\local;" + $env:Path;
- New-Item -ItemType Directory -Force -Path build
- cd build
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x86" -D"PYTHON_MODULE_PATH=python" -D"RUBY_MODULE_PATH=ruby" -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_CXX_FLAGS=-m32" -D"CMAKE_EXE_LINKER_FLAGS=-Wl,--large-address-aware" -D"CMAKE_C_FLAGS=-m32" ../
- mingw32-make install
- $PROJECT_VERSION = (Select-String -Path "../CMakeLists.txt" -Pattern '^set\(PROJECT_VERSION_FULL "(.*)\"' | %{$_.Matches.Groups[1].value})
- $PROJECT_SO = (Select-String -Path "../CMakeLists.txt" -Pattern '^set\(PROJECT_SO_VERSION (.*)\)' | %{$_.Matches.Groups[1].value})
- New-Item -path "install-x86/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$CI_PIPELINE_ID`nVERSION:$PROJECT_VERSION`nSO:$PROJECT_SO" -ItemType file -force
- $env:Path = "C:\msys64\mingw32\bin;C:\msys64\usr\bin;C:\msys64\usr\local\bin;" + $env:Path;
- $env:MSYSTEM = "MINGW32"
- cmake -B build -S . -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR\build\install-x86" -D"OpenShotAudio_ROOT=$CI_PROJECT_DIR\build\install-x86" -D"PYTHON_MODULE_PATH=python" -D"RUBY_MODULE_PATH=ruby" -G "MinGW Makefiles" -D"CMAKE_BUILD_TYPE:STRING=Release" -D"CMAKE_CXX_FLAGS=-m32" -D"CMAKE_EXE_LINKER_FLAGS=-Wl,--large-address-aware" -D"CMAKE_C_FLAGS=-m32"
- cmake --build build
- cmake --build build --target coverage
- cmake --install build
- $PROJECT_VERSION = (Select-String -Path "CMakeLists.txt" -Pattern '^set\(PROJECT_VERSION_FULL "(.*)\"' | %{$_.Matches.Groups[1].value})
- $PROJECT_SO = (Select-String -Path "CMakeLists.txt" -Pattern '^set\(PROJECT_SO_VERSION (.*)\)' | %{$_.Matches.Groups[1].value})
- New-Item -path "build/install-x86/share/" -Name "$CI_PROJECT_NAME" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$CI_PIPELINE_ID`nVERSION:$PROJECT_VERSION`nSO:$PROJECT_SO" -ItemType file -force
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "install-x86/share/$CI_PROJECT_NAME.log"
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x86/share/$CI_PROJECT_NAME.log"
when: always
except:
- tags
Expand Down
59 changes: 41 additions & 18 deletions CMakeLists.txt
Expand Up @@ -69,14 +69,16 @@ include(GNUInstallDirs)
# Collect and display summary of options/dependencies
include(FeatureSummary)

# Unit test management
include(CTest)

################ OPTIONS ##################
# Optional build settings for libopenshot
option(USE_SYSTEM_JSONCPP "Use system installed JsonCpp, if found" ON)
option(DISABLE_BUNDLED_JSONCPP "Don't fall back to bundled JsonCpp" OFF)

option(ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+)" OFF)

option(ENABLE_TESTS "Build unit tests (requires Catch2)" ON)
option(ENABLE_PARALLEL_CTEST "Run CTest using multiple processors" ON)
option(ENABLE_COVERAGE "Scan test coverage using gcov and report" OFF)

Expand All @@ -88,11 +90,11 @@ option(ENABLE_OPENCV "Build with OpenCV algorithms (requires Boost, Protobuf 3)"

# Legacy commandline override
if (DISABLE_TESTS)
set(ENABLE_TESTS OFF)
set(BUILD_TESTING OFF)
endif()

if(DEFINED ENABLE_TESTS)
set(ENABLE_TESTS ${ENABLE_TESTS} CACHE BOOL "Build unit tests (requires Catch2)" FORCE)
if(ENABLE_TESTS)
set(BUILD_TESTING ${ENABLE_TESTS})
endif()

#### Work around a GCC < 9 bug with handling of _Pragma() in macros
Expand Down Expand Up @@ -173,47 +175,68 @@ if (ENABLE_DOCS)
endif()

############# PROCESS tests/ DIRECTORY ##############
if(ENABLE_TESTS)
set(TESTS_ENABLED TRUE) # May be overridden by tests/CMakeLists.txt
find_package(Catch2 REQUIRED)
find_package(Catch2 QUIET)
if(NOT Catch2_FOUND)
set(BUILD_TESTING FALSE)
endif()
if(BUILD_TESTING)
include(Catch)
if(ENABLE_PARALLEL_CTEST)
# Figure out the amount of parallelism for CTest
include(ProcessorCount)
ProcessorCount(CPU_COUNT)
if(NOT CPU_COUNT EQUAL 0)
message(STATUS "Setting up unit tests to use ${CPU_COUNT} processors")
if(CPU_COUNT GREATER 1)
add_feature_info("Parallel tests" TRUE "Unit tests can use ${CPU_COUNT} processors")
set(CTEST_OPTIONS "-j${CPU_COUNT}")
endif()
endif()
include(CTest)
include(Catch)
add_subdirectory(tests)
endif()
add_feature_info("Unit tests" TESTS_ENABLED "Compile unit tests for library functions")
add_feature_info("Unit tests" ${BUILD_TESTING} "Compile unit tests for library functions")

############## COVERAGE REPORTING #################
if (ENABLE_COVERAGE AND DEFINED UNIT_TEST_TARGETS)
set(COVERAGE_EXCLUDES
"bindings/*"
"examples/*"
"${CMAKE_CURRENT_BINARY_DIR}/bindings/*"
"${CMAKE_CURRENT_BINARY_DIR}/src/*_autogen/*"
)
setup_target_for_coverage_lcov(
NAME coverage
LCOV_ARGS "--no-external"
EXECUTABLE ctest
EXECUTABLE_ARGS ${CTEST_OPTIONS}
DEPENDENCIES openshot ${UNIT_TEST_TARGETS}
EXCLUDE
"bindings/*"
"examples/*"
"${CMAKE_CURRENT_BINARY_DIR}/bindings/*"
"${CMAKE_CURRENT_BINARY_DIR}/src/*_autogen/*"
EXCLUDE ${COVERAGE_EXCLUDES}
)
foreach(_t IN LISTS UNIT_TEST_NAMES)
setup_target_for_coverage_lcov(
NAME "${_t}_coverage"
LCOV_ARGS "--no-external"
EXECUTABLE ctest
EXECUTABLE_ARGS ${CTEST_OPTIONS} -L "^${_t}$"
DEPENDENCIES openshot openshot-${_t}-test
EXCLUDE ${COVERAGE_EXCLUDES}
)
endforeach()
endif()

if(TESTS_ENABLED AND NOT TARGET coverage)
if(DEFINED UNIT_TEST_TARGETS AND NOT TARGET coverage)
add_custom_target(coverage
COMMAND ctest ${CTEST_OPTIONS}
DEPENDS openshot ${UNIT_TEST_TARGETS}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Running unit tests (coverage disabled)"
)
foreach(_t IN LISTS UNIT_TEST_NAMES)
add_custom_target("${_t}_coverage"
COMMAND ctest ${CTEST_OPTIONS} -L "^${_t}$"
DEPENDS openshot openshot-${_t}-test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Running unit tests for ${_t} class (coverage disabled)"
)
endforeach()
endif()

if(TARGET test AND NOT TARGET os_test)
Expand Down
33 changes: 0 additions & 33 deletions cmake/Modules/FindJack.cmake

This file was deleted.

0 comments on commit 4d9d6ec

Please sign in to comment.