mirror of
https://github.com/KDE/konsole.git
synced 2025-12-23 23:38:08 -05:00
Add bare conan package test
This commit is contained in:
16
test_package/CMakeLists.txt
Normal file
16
test_package/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(PackageTest CXX)
|
||||
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup(TARGETS)
|
||||
|
||||
add_executable(${PROJECT_NAME} main.cpp)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
CONAN_PKG::konsole
|
||||
)
|
||||
|
||||
# CTest is a testing tool that can be used to test your project.
|
||||
# enable_testing()
|
||||
# add_test(NAME example
|
||||
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
# COMMAND example)
|
||||
25
test_package/conanfile.py
Normal file
25
test_package/conanfile.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
|
||||
from conans import ConanFile, CMake, tools
|
||||
|
||||
|
||||
class KonsoleTestConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
generators = "cmake"
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
|
||||
# in "test_package"
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def imports(self):
|
||||
self.copy("*.dll", dst="bin", src="bin")
|
||||
self.copy("*.dylib*", dst="bin", src="lib")
|
||||
self.copy('*.so*', dst='bin', src='lib')
|
||||
|
||||
def test(self):
|
||||
if not tools.cross_building(self.settings):
|
||||
os.chdir("bin")
|
||||
self.run(".%sPackageTest" % os.sep)
|
||||
5
test_package/main.cpp
Normal file
5
test_package/main.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user