diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14d2da3..34cf3c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,8 @@ jobs: - name: conan export run: conan export ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} - # test_package + - name: conan test + run: conan test ${{ matrix.package.conanfile }} ${{ matrix.package.package_version }} - name: conan upload run: conan upload "*" --check --confirm --remote odr diff --git a/recipes/odrcore/all/test_package/CMakeLists.txt b/recipes/odrcore/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..74efc83 --- /dev/null +++ b/recipes/odrcore/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(cryptopp REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE odr::odr) diff --git a/recipes/odrcore/all/test_package/conanfile.py b/recipes/odrcore/all/test_package/conanfile.py new file mode 100644 index 0000000..93cd04f --- /dev/null +++ b/recipes/odrcore/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/odrcore/all/test_package/test_package.cpp b/recipes/odrcore/all/test_package/test_package.cpp new file mode 100644 index 0000000..f7b9653 --- /dev/null +++ b/recipes/odrcore/all/test_package/test_package.cpp @@ -0,0 +1,7 @@ +#include "odr/open_document_reader.hpp" + +#include + +int main() { + return 0; +}