Clean cmake test configuration after change to cmake_common. (#129)

* Clean cmake test configuration after change to cmake_common.
* Remove appveyor.yml.
This commit is contained in:
Mikaël Capelle
2024-06-22 08:27:42 +02:00
committed by GitHub
parent 5bb4de039e
commit 7cfc761e40
2 changed files with 10 additions and 61 deletions
-48
View File
@@ -1,48 +0,0 @@
version: 1.0.{build}
skip_branch_with_pr: true
image: Visual Studio 2019
environment:
WEBHOOK_URL:
secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1Vbg57wBaeLhi49uGjxPw5GVujHku6kxN6ab89zhbS5GVeluR76GM83IbKV4Sh7udXzoYZZdg6YudtYHzdhCgUeiedpswbuczTq9ceIkkfSEWZuh/lMAAVVwvcGsJAnoPFw=
build:
parallel: true
build_script:
- pwsh: >-
$ErrorActionPreference = 'Stop'
git clone --depth=1 --no-single-branch https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella
New-Item -ItemType Directory -Path c:\projects\modorganizer-build
cd c:\projects\modorganizer-umbrella
($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH -eq $null) ? ($branch = $env:APPVEYOR_REPO_BRANCH) : ($branch = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH)
git checkout $(git show-ref --verify --quiet refs/remotes/origin/${branch} || echo '-b') ${branch}
C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True ${env:APPVEYOR_PROJECT_NAME}
if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) }
artifacts:
- path: vsbuild\src\RelWithDebInfo\proxy\plugin_python.dll
name: plugin_python_dll
- path: vsbuild\src\RelWithDebInfo\proxy\plugin_python.pdb
name: plugin_python_pdb
- path: vsbuild\src\RelWithDebInfo\proxy\plugin_python.lib
name: plugin_python_lib
- path: vsbuild\src\RelWithDebInfo\runner\pythonrunner.dll
name: pythonrunner_dll
- path: vsbuild\src\RelWithDebInfo\runner\pythonrunner.pdb
name: pythonrunner_pdb
- path: vsbuild\src\RelWithDebInfo\runner\pythonrunner.lib
name: pythonrunner_lib
on_success:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 success $env:WEBHOOK_URL
on_failure:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stdout.log
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stderr.log
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 failure $env:WEBHOOK_URL
+10 -13
View File
@@ -5,17 +5,23 @@ cmake_minimum_required(VERSION 3.22)
# first we configure the tests as with other tests
add_executable(runner-tests EXCLUDE_FROM_ALL)
mo2_configure_tests(runner-tests WARNINGS OFF)
set_target_properties(runner-tests PROPERTIES FOLDER tests/runner)
# link to runner
target_link_libraries(runner-tests PUBLIC runner)
# linking to Python - this is not required to get proper linking but required so that
# CMake generator variables will lookup appropriate DLLs for Python and update PATH
# accordingly thanks to mo2_configure_tests
target_link_libraries(runner-tests PUBLIC Python::Python)
# add mocks
target_include_directories(runner-tests
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../mocks)
# link to runner
target_link_libraries(runner-tests PUBLIC runner)
set(PYLIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/pylibs)
mo2_python_pip_install(runner-tests
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pylibs
@@ -26,20 +32,11 @@ mo2_python_pip_install(runner-tests
add_dependencies(runner-tests mobase)
# we set multiple properties, including:
# - updated PATH for DLLs (Qt, etc.), Python and runner
# - PYTHONPATH
set(pythoncore "${PYTHON_ROOT}/PCbuild/amd64/pythoncore")
set(pythoncorezip "${pythoncore}/python${Python_VERSION_SHORT}.zip")
set(PYTHONPATH "${PYLIB_DIR}\\;$<TARGET_FILE_DIR:mobase>\\;${pythoncore}\\;${pythoncorezip}")
set(extra_paths "${MO2_INSTALL_PATH}/bin/dlls")
string(APPEND extra_paths "\\;${PYTHON_ROOT}/PCbuild/amd64")
string(APPEND extra_paths "\\;$<TARGET_FILE_DIR:runner>")
set_tests_properties(${runner-tests_gtests}
PROPERTIES
ENVIRONMENT "PLUGIN_DIR=${CMAKE_CURRENT_SOURCE_DIR}/plugins"
ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:${extra_paths};PYTHONPATH=set:${PYTHONPATH}"
ENVIRONMENT "PLUGIN_DIR=${CMAKE_CURRENT_SOURCE_DIR}/plugins;PYTHONPATH=${PYTHONPATH}"
)