You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge pull request #828 from ferdnyc/catch-upgrade
Make unit tests work with Catch2v3 (for macOS CI)
This commit is contained in:
@@ -68,20 +68,37 @@ if(NOT BUILD_TESTING)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Create object library for test executable main(),
|
||||
# to avoid recompiling for every test
|
||||
add_library(catch-main OBJECT catch_main.cpp)
|
||||
target_link_libraries(catch-main PUBLIC Catch2::Catch2)
|
||||
add_library(openshot_catch2 INTERFACE)
|
||||
target_include_directories(openshot_catch2 INTERFACE
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
target_compile_definitions(openshot_catch2 INTERFACE
|
||||
TEST_MEDIA_PATH="${TEST_MEDIA_PATH}")
|
||||
|
||||
if(TARGET Catch2::Catch2WithMain)
|
||||
# Catch2 v3 works a bit differently
|
||||
configure_file(catch2v3.h.in openshot_catch.h)
|
||||
target_link_libraries(openshot_catch2 INTERFACE Catch2::Catch2WithMain)
|
||||
else()
|
||||
configure_file(catch2v2.h.in openshot_catch.h)
|
||||
# Create object library for test executable main(),
|
||||
# to avoid recompiling for every test
|
||||
add_library(catch-main OBJECT catch_main.cpp)
|
||||
target_link_libraries(catch-main PUBLIC Catch2::Catch2)
|
||||
target_include_directories(catch-main PUBLIC
|
||||
"${CMAKE_CURRENT_BINARY_DIR}")
|
||||
target_link_libraries(openshot_catch2 INTERFACE Catch2::Catch2)
|
||||
target_sources(openshot_catch2 INTERFACE $<TARGET_OBJECTS:catch-main>)
|
||||
endif()
|
||||
|
||||
foreach(tname ${OPENSHOT_TESTS})
|
||||
add_executable(openshot-${tname}-test
|
||||
${tname}.cpp
|
||||
$<TARGET_OBJECTS:catch-main>
|
||||
)
|
||||
target_compile_definitions(openshot-${tname}-test PRIVATE
|
||||
TEST_MEDIA_PATH="${TEST_MEDIA_PATH}"
|
||||
target_link_libraries(openshot-${tname}-test
|
||||
openshot_catch2
|
||||
openshot
|
||||
)
|
||||
target_link_libraries(openshot-${tname}-test Catch2::Catch2 openshot)
|
||||
|
||||
# Automatically configure CTest targets from Catch2 test cases
|
||||
catch_discover_tests(
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "Clip.h"
|
||||
#include "CVObjectDetection.h"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "Clip.h"
|
||||
#include "CVStabilization.h" // for TransformParam, CamTrajectory, CVStabilization
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "Clip.h"
|
||||
#include "CVTracker.h" // for FrameData, CVTracker
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <memory>
|
||||
#include <QDir>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "CacheDisk.h"
|
||||
#include "Frame.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <memory>
|
||||
#include <QDir>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "CacheMemory.h"
|
||||
#include "Frame.h"
|
||||
|
||||
@@ -28,7 +28,7 @@ std::ostream& operator << ( std::ostream& os, QColor const& value ) {
|
||||
return os;
|
||||
}
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
using namespace openshot;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QImage>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include <QColor>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "Coordinate.h"
|
||||
#include "Exceptions.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "Frame.h"
|
||||
#include "effects/Crop.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "DummyReader.h"
|
||||
#include "Exceptions.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "FFmpegReader.h"
|
||||
#include "Exceptions.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "FFmpegWriter.h"
|
||||
#include "Exceptions.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#undef uint64
|
||||
#endif
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "Clip.h"
|
||||
#include "Fraction.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "CacheMemory.h"
|
||||
#include "Clip.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include "ImageWriter.h"
|
||||
#include "Exceptions.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
#include "openshot_catch.h"
|
||||
#include <sstream>
|
||||
|
||||
#include "Point.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user