Skip to content

Commit

Permalink
Merge pull request #639 from Kicer86/github_lfs
Browse files Browse the repository at this point in the history
Disable GitHub lfs usage
  • Loading branch information
Kicer86 committed Jun 2, 2024
2 parents 0324a07 + 15178e2 commit 367bc5a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
lfs: true
lfs: false # TODO: reeanble after cleanups with LFS on github side

- name: Install system dependencies
run: |
Expand Down Expand Up @@ -100,6 +100,7 @@ jobs:
-DCMAKE_EXE_LINKER_FLAGS=--coverage
run-test: true
ctest-options:
-LE HeavyData # TODO: remove after cleanups with LFS on github side
--output-on-failure

- name: Generate lcov raports
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
lfs: true
lfs: false

- name: Install system dependencies
run: |
Expand Down Expand Up @@ -107,6 +107,7 @@ jobs:
-Wdev -Werror=dev
run-test: true
ctest-options:
-LE HeavyData
--output-on-failure
env:
TSAN_OPTIONS=suppressions: ${{ runner.workspace }}/photobroom/sanitizer-thread-suppressions.txt
16 changes: 9 additions & 7 deletions cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ endfunction()


# helper function for creating unit tests with sanitizers enabled
macro(addSanitizers target test_prefix)
macro(addSanitizers target test_prefix extra_labels)

#clone target
cloneTarget(${target} ${target}_addr)
Expand Down Expand Up @@ -75,17 +75,19 @@ macro(addSanitizers target test_prefix)
add_test(${test_prefix}_leak ${target}_leak)
add_test(${test_prefix}_ub ${target}_ub)

set_tests_properties(${test_prefix}_addr PROPERTIES LABELS "UnitTest;Sanitizer;Address")
set_tests_properties(${test_prefix}_thread PROPERTIES LABELS "UnitTest;Sanitizer;Thread")
set_tests_properties(${test_prefix}_leak PROPERTIES LABELS "UnitTest;Sanitizer;Leak")
set_tests_properties(${test_prefix}_ub PROPERTIES LABELS "UnitTest;Sanitizer;UndefinedBehavior")
set_tests_properties(${test_prefix}_addr PROPERTIES LABELS "UnitTest;Sanitizer;Address;${extra_labels}")
set_tests_properties(${test_prefix}_thread PROPERTIES LABELS "UnitTest;Sanitizer;Thread;${extra_labels}")
set_tests_properties(${test_prefix}_leak PROPERTIES LABELS "UnitTest;Sanitizer;Leak;${extra_labels}")
set_tests_properties(${test_prefix}_ub PROPERTIES LABELS "UnitTest;Sanitizer;UndefinedBehavior;${extra_labels}")

endmacro(addSanitizers)


# do some universal setup for a unit test
function(register_unit_test unit_test executable)
set_tests_properties(${unit_test} PROPERTIES LABELS "UnitTest")
set(extra_labels "${ARGN}")

set_tests_properties(${unit_test} PROPERTIES LABELS "UnitTest;${extra_labels}")

if(RUN_TESTS_AFTER_BUILD)
add_custom_command(TARGET ${executable}
Expand All @@ -96,7 +98,7 @@ function(register_unit_test unit_test executable)
endif()

if(ENABLE_SANITIZERS_FOR_TESTS)
addSanitizers(${executable} ${unit_test})
addSanitizers(${executable} ${unit_test} "${extra_labels}")
endif()
endfunction()

Expand Down
50 changes: 48 additions & 2 deletions src/core/core_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,13 @@ add_executable(core_ut
unit_tests/qmodelindex_selector_tests.cpp
unit_tests/status_tests.cpp
unit_tests/tag_value_tests.cpp
unit_tests/video_metadata_extraction_tests.cpp
)

target_link_libraries(core_ut
PRIVATE
${EXIV2_LIB}
${FFMPEG_LIBRARIES}
GTest::gtest
GTest::gmock
GTest::gmock_main
Qt::Core
Qt::Gui
Expand Down Expand Up @@ -180,3 +178,51 @@ add_test(
)

register_unit_test(core core_ut)


add_executable(core_video_ut
implementation/aexif_reader.cpp
implementation/base_tags.cpp
implementation/exiv2_exif_reader.cpp
implementation/exif_reader_factory.cpp
implementation/image_media_information.cpp
implementation/media_information.cpp
implementation/media_types.cpp
implementation/tag.cpp
implementation/video_media_information.cpp

unit_tests/video_metadata_extraction_tests.cpp
)

target_link_libraries(core_video_ut
PRIVATE
${EXIV2_LIB}
${FFMPEG_LIBRARIES}
GTest::gtest
GTest::gmock_main
Qt::Core
Qt::Gui
opencv_tracking
)

target_include_directories(core_video_ut
PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}
)

target_compile_definitions(core_video_ut
PRIVATE
CORE_STATIC_DEFINE # disable visibility mechanisms to prevent inconsistent dll linkage warnings
)

set_target_properties(core_video_ut PROPERTIES AUTOMOC TRUE)

add_test(
NAME core_video
COMMAND core_video_ut
)

register_unit_test(core_video core_video_ut "HeavyData")

0 comments on commit 367bc5a

Please sign in to comment.