# Unit Tests

[Fluent Bit](http://fluentbit.io) comes with some unit test programs that uses the *library* mode to ingest data and test the output. The tests are based on [Google Test](https://code.google.com/p/googletest/) suite and requires a C++ compiler.

## Requirements

In order to build and run the tests, your system needs a C++ compiler and an installed version of [gtest](https://code.google.com/p/googletest/). On Debian/Ubuntu systems the following commands will install the dependencies:

```bash
$ sudo apt-get install g++ libgtest-dev
```

Note that *libgtest-dev* will **only** install the sources of the test suite, you need to take some extra steps to make this work:

```bash
$ cd /usr/src/gtest
$ sudo cmake .
$ sudo make
$ sudo cp libg* /usr/lib/
```

## Enable Tests

By default [Fluent Bit](http://fluentbit.io) have the tests disabled, you need to append the *ENABLE\_TESTS* option to your **cmake** line, e.g:

```bash
$ cd build/
$ cmake -DFLB_TESTS=ON ../
```

## Running Tests

To run the tests just issue the following command:

```bash
$ make test
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fluentbit.io/manual/1.0/installation/unit_tests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
