diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt new file mode 100644 index 000000000..c5f403c50 --- /dev/null +++ b/test_package/CMakeLists.txt @@ -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) diff --git a/test_package/conanfile.py b/test_package/conanfile.py new file mode 100644 index 000000000..f5b4093b1 --- /dev/null +++ b/test_package/conanfile.py @@ -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/" 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) diff --git a/test_package/main.cpp b/test_package/main.cpp new file mode 100644 index 000000000..1ac82fd91 --- /dev/null +++ b/test_package/main.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + return 0; +}