title: Testing Apache Celix

Testing Apache Celix

This document describes how to build and run tests for Apache Celix.

Building Tests

Celix uses CMake and Google Test for its unit and integration tests. To build the tests, ensure you have all dependencies installed, then run:

cmake -B build -DENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build
#conan

To enable AddressSanitizer (ASAN) when building tests, configure CMake with the `ENABLE_ASAN` option:

```sh
cmake -B build -DENABLE_TESTING=ON -DENABLE_ADDRESS_SANITIZER=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build

This will build Apache Celix and its tests with ASAN enabled, helping to detect memory errors during test execution.

Running Tests

After building, you can run all tests using CTest:

ctest --output-on-failure --test-dir build

Or run a test for a specific subdir, e.g.:

ctest --output-on-failure --test-dir build/bundles/shell

Or run a specific test binary directly from the build directory, e.g.:

./build/bundles/components_ready_check/tests/components_ready_check_test