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

Qml catch2 console #52

Merged
merged 28 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a359368
wip
adam-ce Nov 18, 2023
dfc22a6
integrate qml catch2 console + make android builds work again
adam-ce Nov 19, 2023
bcdc972
add android icon
adam-ce Nov 19, 2023
d38245c
move gl and nucleus unit tests to /unittests + make gl tests work aga…
adam-ce Nov 19, 2023
e57ebd7
remove obsolete files
adam-ce Nov 19, 2023
1eee211
update git workflow
adam-ce Nov 19, 2023
f3e7dd8
try debug github actions
adam-ce Nov 19, 2023
7cd1599
try to fix linux by providing dependencies
adam-ce Nov 19, 2023
d802b2f
try fixing run file
adam-ce Nov 19, 2023
e3139ac
try fixing run on windows
adam-ce Nov 19, 2023
5375af5
actually, also install package that was explicitly mentioned as missi…
adam-ce Nov 19, 2023
b476c1a
try to fix unittests for nucleus
adam-ce Nov 19, 2023
3dfd879
next iteration of trying to get unittests to work. nucleus works on l…
adam-ce Nov 19, 2023
8d2b485
try to find windows tests
adam-ce Nov 19, 2023
b3ad04c
try to install opengl software backend on linux
adam-ce Nov 19, 2023
abc5390
opengl install failed for yml syntax
adam-ce Nov 19, 2023
16b5a97
do run on windows
adam-ce Nov 19, 2023
e2439a3
try again to install opengl software renderer
adam-ce Nov 19, 2023
cbbd18b
opengl install failed
adam-ce Nov 19, 2023
4779b87
it seems that not all tests on windows are run
adam-ce Nov 19, 2023
87a9182
try opengl on linux again
adam-ce Nov 19, 2023
85de6ab
temporary test for github actions
adam-ce Nov 19, 2023
7a09741
next try: windows-> try not to use msys/mingw, but ninja+msvc; linux-…
adam-ce Nov 19, 2023
e7d1666
try again with cmd shell
adam-ce Nov 19, 2023
45b50c1
try to debug linux failing ci gl tests
adam-ce Nov 19, 2023
c316bb9
try to make windows build
adam-ce Nov 19, 2023
c10cb24
abandon opengl software renderer for now
adam-ce Nov 19, 2023
c5c52c2
abandon windows build and test for now. msys (mingw) didn't run. msvc…
adam-ce Nov 19, 2023
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
73 changes: 57 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
#os: [ubuntu-latest, windows-latest]
build_type: [Release]
include:
- os: windows-latest
arch: 'win64_mingw'
host: 'windows'
shell: 'msys2 {0}'
#- os: windows-latest
#arch: 'win64_mingw'
#host: 'windows'
#shell: 'cmd'
#shell: 'msys2 {0}'
- os: ubuntu-latest
arch: 'gcc_64'
host: 'linux'
Expand All @@ -33,13 +35,24 @@ jobs:
with:
submodules: 'true'

- name: Install MSYS2
- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main

- name: Make sure MSVC is found when Ninja generator is in use
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake git
msystem: mingw64
release: false
uses: ilammy/msvc-dev-cmd@v1

#- name: Install MSYS2
#if: matrix.os == 'windows-latest'
#uses: msys2/setup-msys2@v2
#with:
#install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake git
#msystem: mingw64
#release: false

- name: Install Linux Dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y build-essential libgl1-mesa-dev libxcb-cursor-dev xorg-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb

- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand All @@ -55,12 +68,40 @@ jobs:
- name: Configure
env:
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}/lib/cmake
run: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DALP_ENABLE_POSITIONING=false -B '${{github.workspace}}'/build
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DALP_ENABLE_POSITIONING=false -B ./build

- name: Build
run: cmake --build '${{github.workspace}}'/build
run: cmake --build ./build

- name: Test
- name: Test on Linux
if: matrix.os == 'ubuntu-latest'
env:
QT_QPA_PLATFORM: xcb
QT_DEBUG_PLUGINS: 1
DISPLAY: 1
run: |
./build/alp_external/radix/unittests/unittests_radix
./build/unittests/nucleus/unittests_nucleus
#Xvfb :1 -screen 0 1024x768x16 &
#./build/unittests/gl_engine/unittests_gl_engine # doesn't work

- name: Test radix on Windows
if: matrix.os == 'windows-latest'
env:
QT_DEBUG_PLUGINS: 1
run: |
./build/alp_external/radix/unittests/unittests_radix.exe

- name: Test nucleus on Windows
if: matrix.os == 'windows-latest'
env:
QT_DEBUG_PLUGINS: 1
run: |
./build/unittests/unittests_nucleus.exe

- name: Test gl_engine on Windows
if: matrix.os == 'windows-latest'
env:
QT_DEBUG_PLUGINS: 1
run: |
'${{github.workspace}}'/build/unittests/unittests_nucleus
'${{github.workspace}}'/build/unittests_gl/unittests_gl_engine
./build/unittests/unittests_gl_engine.exe
26 changes: 4 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ endif()

########################################### dependencies #################################################
find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Network Quick QuickControls2 LinguistTools Svg Charts)
qt_policy(
SET QTP0002 NEW
)
if (ALP_ENABLE_POSITIONING)
find_package(Qt6 REQUIRED COMPONENTS Positioning)
endif()
Expand All @@ -80,7 +83,7 @@ alp_add_git_repository(renderer_static_data URL https://github.com/AlpineMapsOrg
alp_add_git_repository(alpineapp_fonts URL https://github.com/AlpineMapsOrg/fonts.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT)

if (ANDROID)
alp_add_git_repository(android_openssl URL https://github.com/AlpineMapsOrg/android_openssl.git COMMITISH origin/master DO_NOT_ADD_SUBPROJECT)
alp_add_git_repository(android_openssl URL https://github.com/KDAB/android_openssl.git COMMITISH origin/master DO_NOT_ADD_SUBPROJECT)
include(${android_openssl_SOURCE_DIR}/android_openssl.cmake)
endif()

Expand All @@ -90,26 +93,5 @@ add_subdirectory(plain_renderer)
add_subdirectory(app)

if (ALP_UNITTESTS)
find_package(Qt6 REQUIRED COMPONENTS Test)
if (NOT TARGET Catch2)
alp_add_git_repository(catch2 URL https://github.com/catchorg/Catch2.git COMMITISH v3.4.0)
endif()

if (EMSCRIPTEN AND ALP_ENABLE_THREADING)
target_compile_options(Catch2 PRIVATE -pthread)
endif()
function(alp_setup_unittest)
if (ANDROID)
install(TARGETS ${ARGV0}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

if (MINGW)
target_compile_options(${ARGV0} PUBLIC "-Wa,-mbig-obj")
endif()
endfunction()

add_subdirectory(unittests)
add_subdirectory(unittests_gl)
endif()
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ else()
endif()

if (ANDROID)
add_android_openssl_libraries_to(alpineapp)
add_android_openssl_libraries(alpineapp)

install(TARGETS alpineapp
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
58 changes: 14 additions & 44 deletions app/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.alpinemaps.app"
android:installLocation="auto"
android:versionCode="-- %%INSERT_VERSION_CODE%% --"
android:versionName="-- %%INSERT_VERSION_NAME%% --">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.alpinemaps.app" android:installLocation="auto" android:versionCode="-- %%INSERT_VERSION_CODE%% --" android:versionName="-- %%INSERT_VERSION_NAME%% --">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<!-- %%INSERT_PERMISSIONS -->
<!-- %%INSERT_FEATURES -->
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<application
android:name="org.qtproject.qt.android.bindings.QtApplication"
android:hardwareAccelerated="true"
android:label="AlpineMaps"
android:requestLegacyExternalStorage="true"
android:allowNativeHeapPointerTagging="false"
android:allowBackup="true"
android:fullBackupOnly="false">
<activity
android:name="org.qtproject.qt.android.bindings.QtActivity"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:label="AlpineMaps"
android:launchMode="singleTop"
android:screenOrientation="unspecified"
android:exported="true">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
<application android:name="org.qtproject.qt.android.bindings.QtApplication" android:hardwareAccelerated="true" android:label="AlpineMaps" android:requestLegacyExternalStorage="true" android:allowNativeHeapPointerTagging="false" android:allowBackup="true" android:fullBackupOnly="false" android:icon="@drawable/icon">
<activity android:name="org.qtproject.qt.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:label="AlpineMaps" android:launchMode="singleTop" android:screenOrientation="unspecified" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

<meta-data
android:name="android.app.lib_name"
android:value="-- %%INSERT_APP_LIB_NAME%% --" />

<meta-data
android:name="android.app.arguments"
android:value="-- %%INSERT_APP_ARGUMENTS%% --" />

<meta-data
android:name="android.app.extract_android_style"
android:value="minimal" />
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/>
<meta-data android:name="android.app.extract_android_style" android:value="minimal"/>
</activity>
</application>
</manifest>
Binary file added app/android/res/drawable-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/android/res/drawable-ldpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/android/res/drawable-mdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/android/res/drawable-xhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/android/res/drawable-xxhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/android/res/drawable-xxxhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions cmake/alp_add_unittest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#############################################################################
# Alpine Terrain Renderer
# Copyright (C) 2023 Adam Celarek <family name at cg tuwien ac at>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#############################################################################

find_package(Qt6 REQUIRED COMPONENTS Test)
if (NOT TARGET Catch2)
alp_add_git_repository(catch2 URL https://github.com/catchorg/Catch2.git COMMITISH v3.4.0)
endif()

if (EMSCRIPTEN AND ALP_ENABLE_THREADING)
target_compile_options(Catch2 PRIVATE -pthread)
endif()

include(${qml_catch2_console_SOURCE_DIR}/src/qml_catch2_console.cmake)

function(alp_add_unittest name)
if(EMSCRIPTEN)
add_qml_catch2_console_unittests(${name} ${ARGN})
set(ALP_INSTALL_FILES
"$<TARGET_FILE_DIR:${name}>/${name}.js"
"$<TARGET_FILE_DIR:${name}>/${name}.wasm"
"$<TARGET_FILE_DIR:${name}>/${name}.html"
"$<TARGET_FILE_DIR:${name}>/qtloader.js"
)

if (ALP_ENABLE_THREADING)
list(APPEND ALP_INSTALL_FILES "$<TARGET_FILE_DIR:${name}>/${name}.worker.js")
endif()
install(FILES ${ALP_INSTALL_FILES} DESTINATION ${ALP_WWW_INSTALL_DIR})
else()
qt_add_executable(${name} ${ARGN} ${CMAKE_SOURCE_DIR}/unittests/main.cpp)
target_link_libraries(${name} PUBLIC Catch2::Catch2)
endif()
endfunction()
4 changes: 3 additions & 1 deletion nucleus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ project(alpine-renderer-nucleus LANGUAGES CXX)

alp_add_git_repository(radix URL https://github.com/AlpineMapsOrg/radix.git COMMITISH origin/main)
alp_add_git_repository(tl_expected URL https://github.com/TartanLlama/expected.git COMMITISH v1.1.0 DO_NOT_ADD_SUBPROJECT)
alp_add_git_repository(fmt URL https://github.com/fmtlib/fmt.git COMMITISH 10.1.1)
if (NOT TARGET fmt)
alp_add_git_repository(fmt URL https://github.com/fmtlib/fmt.git COMMITISH 10.1.1)
endif()
alp_add_git_repository(zppbits URL https://github.com/eyalz800/zpp_bits.git COMMITISH v4.4.20 DO_NOT_ADD_SUBPROJECT)

add_library(zppbits INTERFACE)
Expand Down
3 changes: 1 addition & 2 deletions plain_renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ qt_add_resources(plain_renderer "height_data"

if (EMSCRIPTEN)
message(NOTICE "ALP_WWW_INSTALL_DIR = ${ALP_WWW_INSTALL_DIR}")
configure_file(../site/plain_renderer.html plain_renderer.html COPYONLY)
configure_file(../site/mascot.png mascot.png COPYONLY)
set(ALP_INSTALL_FILES
"$<TARGET_FILE_DIR:plain_renderer>/plain_renderer.js"
"$<TARGET_FILE_DIR:plain_renderer>/plain_renderer.wasm"
"$<TARGET_FILE_DIR:plain_renderer>/plain_renderer.html"
"$<TARGET_FILE_DIR:plain_renderer>/qtloader.js"
"${CMAKE_SOURCE_DIR}/site/plain_renderer.html"
"${CMAKE_SOURCE_DIR}/site/mascot.png"
)
if (ALP_ENABLE_THREADING)
Expand Down
82 changes: 0 additions & 82 deletions site/ansispan.js

This file was deleted.

Loading