Skip to content

Commit

Permalink
qt-advanced-docking-system: Modernize test package for conan v2
Browse files Browse the repository at this point in the history
  • Loading branch information
leha-bot committed Sep 30, 2023
1 parent 06b1ecd commit 84a5b86
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ project(PackageTest CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(qt-advanced-docking-system CONFIG REQUIRED)

add_executable(example example.cpp)
target_link_libraries(example qt-advanced-docking-system::qt-advanced-docking-system)
target_link_libraries(example qt-advanced-docking-system::qt-advanced-docking-system Qt::Core)
17 changes: 13 additions & 4 deletions recipes/qt-advanced-docking-system/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.build import can_run

Check warning on line 2 in recipes/qt-advanced-docking-system/all/test_package/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed test_package/conanfile.py (v2 migration)

Unused can_run imported from conan.tools.build
from conan.tools.cmake import CMake, cmake_layout
import os


class AdsTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv"
test_type = "explicit"

def requirements(self):
self.requires(self.tested_reference_str)

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
Expand All @@ -13,5 +22,5 @@ def build(self):

def test(self):
if not tools.cross_building(self):

Check failure on line 24 in recipes/qt-advanced-docking-system/all/test_package/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed test_package/conanfile.py (v2 migration)

Undefined variable 'tools'
bin_path = os.path.join("bin", "example")
self.run(bin_path, run_environment=True)
bin_path = os.path.join(self.cpp.build.bindir, "test_package")
self.run(bin_path, env="conanrun")

0 comments on commit 84a5b86

Please sign in to comment.