tree: 4ddcc2f925e5bd860cfa4494d4993b5b783ab212 [path history] [tgz]
  1. CMakeLists.txt
  2. conanfile.py
  3. hello_bundle.c
  4. my_log_writer_activator.c
  5. my_rsa_activator.c
  6. README.md
  7. test_c_rsa_spi.c
  8. test_celix_dfi.c
  9. test_cxx_shell.cpp
  10. test_etcd_lib.c
  11. test_event_admin_api.c
  12. test_event_admin_spi.c
  13. test_framework.c
  14. test_http_admin_activator.c
  15. test_log_helper.c
  16. test_log_service_api.c
  17. test_promises.cpp
  18. test_pushstreams.cpp
  19. test_rsa_spi.cc
  20. test_rsa_utils.cc
  21. test_shell.c
  22. test_shell_api.c
  23. test_utils.c
examples/conan_test_package/README.md

title: Conan Test Package

Conan Test Package

To learn API usage, we refer our users to celix-examples and various tests. The C/C++ source codes in this folder are NOT worth reading.

This example is actually a classical Conan test_package, which is quite different from traditional tests. Its main purpose is to verify that a Celix package is properly installed in the local Conan cache. To this end, it needs to make sure that:

  • Celix CMake commands are usable.
  • Public headers can be included.
  • Libraries are linkable.
  • Bundles are accessible to commands such as add_celix_container.

To create a Celix package in the local cache with C++ support and verify that it's properly installed, run the following command in the Celix root directory:

conan create . celix/2.2.3@zhengpeng/testing -tf examples/conan_test_package/ -o celix:celix_cxx17=True

To verify a Celix package with C++ support is properly installed in the local cache, run the following command in the Celix root directory:

conan test examples/conan_test_package/ celix/2.2.3@zhengpeng/testing  -o celix:celix_cxx17=True

Though it might not be wise to spend time reading C/C++ codes in this folder, it's instructive to have a look at conanfile.py and CMakeLists.txt, which illustrates a non-intrusive way of using Conan with CMake build system. Pay attention to our use of cmake_paths cmake_find_package generators and the following line:

    cmake.definitions["CMAKE_PROJECT_test_package_INCLUDE"] = os.path.join(self.build_folder, "conan_paths.cmake")