diff --git a/recipes/fff/all/conandata.yml b/recipes/fff/all/conandata.yml new file mode 100644 index 0000000000000..43b155015b702 --- /dev/null +++ b/recipes/fff/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.1": + url: https://github.com/meekrosoft/fff/archive/refs/tags/v1.1.zip + sha256: 5a8329878f59bd1ea19b734573d63c228f742384b8c78d00e4d005909b90ee83 diff --git a/recipes/fff/all/conanfile.py b/recipes/fff/all/conanfile.py new file mode 100644 index 0000000000000..b4367b0a79cab --- /dev/null +++ b/recipes/fff/all/conanfile.py @@ -0,0 +1,26 @@ +from conans import ConanFile, tools +import os + +class TypeSafe(ConanFile): + name = 'fff' + description = 'A testing micro framework for creating function test doubles' + url = 'https://github.com/conan-io/conan-center-index' + homepage = 'https://github.com/meekrosoft/fff' + license = 'MIT' + topics = 'conan', 'c', 'c++', 'embedded', 'tdd', 'micro-framework', 'fake-functions' + + no_copy_source = True + + @property + def _source_subfolder(self): + return "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) + + def package(self): + self.copy("LICENSE*", dst="licenses", src=self._source_subfolder) + self.copy("fff.h", dst="include", src=self._source_subfolder) + + def package_id(self): + self.info.header_only() diff --git a/recipes/fff/all/test_package/CMakeLists.txt b/recipes/fff/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..196188113685c --- /dev/null +++ b/recipes/fff/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) diff --git a/recipes/fff/all/test_package/conanfile.py b/recipes/fff/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/fff/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fff/all/test_package/test_package.cpp b/recipes/fff/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..80fdb032c8ac4 --- /dev/null +++ b/recipes/fff/all/test_package/test_package.cpp @@ -0,0 +1,16 @@ +#include +#include "fff.h" + +DEFINE_FFF_GLOBALS; + +FAKE_VOID_FUNC(TestFunction, uint32_t, uint8_t); + +int main() +{ + RESET_FAKE(TestFunction); + FFF_RESET_HISTORY(); + + TestFunction(8, 16); + + return 0; +} diff --git a/recipes/fff/config.yml b/recipes/fff/config.yml new file mode 100644 index 0000000000000..73cff68f18893 --- /dev/null +++ b/recipes/fff/config.yml @@ -0,0 +1,3 @@ +versions: + '1.1': + folder: all