Skip to content

Commit

Permalink
Merge pull request #5322 from opengisch/nirvn-patch-1
Browse files Browse the repository at this point in the history
Reenable macos tests
  • Loading branch information
nirvn authored Jun 9, 2024
2 parents 1f5ca8b + ad3a912 commit bede916
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-D WITH_VCPKG=ON \
-D WITH_NFC=OFF \
-D WITH_SPIX=ON \
-D APP_VERSION="${APP_VERSION}" \
-D APP_VERSION_STR="${APP_VERSION_STR}" \
-D APP_PACKAGE_NAME="${APP_PACKAGE_NAME}" \
Expand Down
32 changes: 16 additions & 16 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,8 @@ endif()
# lrelease .ts files
find_package(Qt6 COMPONENTS LinguistTools)

file(GLOB TS_FILES ${CMAKE_SOURCE_DIR}/i18n/*.ts)
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION
"${CMAKE_BINARY_DIR}")
qt_add_translation(QM_FILES ${TS_FILES})

# include manually copied .qm files
file(GLOB QM_FILES_MANUAL ${CMAKE_SOURCE_DIR}/i18n/*.qm)
list(APPEND QM_FILES ${QM_FILES_MANUAL})

# create translations QRC file
set(TRANSLATIONS_QRC "${CMAKE_BINARY_DIR}/translations.qrc")
file(WRITE ${TRANSLATIONS_QRC} "<RCC>\n <qresource prefix=\"/\">")
foreach(QM_FILE ${QM_FILES})
get_filename_component(QM_FILE_NAME ${QM_FILE} NAME)
file(APPEND ${TRANSLATIONS_QRC}
"\n <file alias=\"i18n/${QM_FILE_NAME}\">${QM_FILE}</file>")
endforeach()
file(APPEND ${TRANSLATIONS_QRC} "\n </qresource>\n</RCC>")

configure_file(${CMAKE_SOURCE_DIR}/images/logo.qrc.in
${CMAKE_BINARY_DIR}/images/logo.qrc @ONLY)
Expand Down Expand Up @@ -69,6 +53,22 @@ function(create_executable)
add_executable(${exe_TARGET} ${exe_EXTRA_ARGS} ${QFIELD_SOURCES})
endif()

file(GLOB TS_FILES ${CMAKE_SOURCE_DIR}/i18n/*.ts)
set_source_files_properties(
${TS_FILES} PROPERTIES OUTPUT_LOCATION
"${CMAKE_BINARY_DIR}/i18n${exe_TARGET}")
qt_add_translation(QM_FILES ${TS_FILES})

qt_add_resources(
${exe_TARGET}
"translations${exe_TARGET}"
PREFIX
"/i18n"
BASE
"${CMAKE_BINARY_DIR}/i18n${exe_TARGET}"
FILES
${QM_FILES})

target_link_libraries(${exe_TARGET} PRIVATE qfield_core qfield_qml)

if(ANDROID)
Expand Down
10 changes: 5 additions & 5 deletions test/spix/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def diff_path():

@pytest.fixture
def screenshot_check(image_diff, image_diff_dir, screenshot_path, diff_path, extra):
def inner(test_name, image_name):
def inner(test_name, image_name, diff_threshold):
# insure no alpha channel present in the screenshot being compared
png = Image.open(
os.path.join(screenshot_path, "{}.png".format(image_name))
Expand All @@ -65,7 +65,7 @@ def inner(test_name, image_name):
result = image_diff(
os.path.join(screenshot_path, "{}.png".format(image_name)),
expected_name,
threshold=0.025,
threshold=diff_threshold,
suffix=image_name,
throw_exception=False,
)
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_wms_layer(app, screenshot_path, screenshot_check, extra, process_alive)
assert process_alive()
extra.append(extras.html('<img src="images/test_wms_layer.png"/>'))

assert screenshot_check("test_wms_layer", "test_wms_layer")
assert screenshot_check("test_wms_layer", "test_wms_layer", 0.025)

messagesCount = 0
for i in range(0, 10):
Expand Down Expand Up @@ -151,7 +151,7 @@ def test_projection(app, screenshot_path, screenshot_check, extra, process_alive
assert process_alive()
extra.append(extras.html('<img src="images/test_projection.png"/>'))

assert screenshot_check("test_projection", "test_projection")
assert screenshot_check("test_projection", "test_projection", 0.062)

messagesCount = 0
for i in range(0, 10):
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_svg(app, screenshot_path, screenshot_check, extra, process_alive):
assert process_alive()
extra.append(extras.html('<img src="images/test_svg.png"/>'))

assert screenshot_check("test_svg", "test_svg")
assert screenshot_check("test_svg", "test_svg", 0.025)


@pytest.mark.project_file("test_postgis_ssl.qgz")
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit bede916

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.