Skip to content

Commit

Permalink
odr test package
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed May 26, 2024
1 parent ada534d commit 70bf40c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions recipes/odrcore/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
26 changes: 26 additions & 0 deletions recipes/odrcore/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -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")
7 changes: 7 additions & 0 deletions recipes/odrcore/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "odr/open_document_reader.hpp"

#include <iostream>

int main() {
return 0;
}

0 comments on commit 70bf40c

Please sign in to comment.