catchorg / catchorg/Catch2

The json reporter does not print results of benchmarks

Open
#2,879 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Describe the bug**
The json reporter does not print results of benchmarks

**Expected result**

The xml reporter provides the benchmark results: [bench.xml.txt](https://github.com/user-attachments/files/15983475/bench.xml.txt)

The json reporter misses the benchmark results: [bench.json](https://github.com/user-attachments/files/15983464/bench.json)

**Reproduction steps**

1. compile the following code with catch2
2. run with `./bench -r json > bench.json`

```c++
#include
#include

#include

std::uint64_t Fibonacci(std::uint64_t number)
{
return number < 2 ? 1 : Fibonacci(number - 1) + Fibonacci(number - 2);
}

TEST_CASE("Fibonacci")
{
CHECK(Fibonacci(0) == 1);
// some more asserts..
CHECK(Fibonacci(5) == 8);
// some more asserts..

// now let's benchmark:
BENCHMARK("Fibonacci 20")
{
return Fibonacci(20);
};

BENCHMARK("Fibonacci 25")
{
return Fibonacci(25);
};

BENCHMARK("Fibonacci 30")
{
return Fibonacci(30);
};

BENCHMARK("Fibonacci 35")
{
return Fibonacci(35);
};
}
```

**Platform information:**
- OS: **Ubuntu 22.04**
- Compiler+version: **GCC 11.4**
- Catch version: **v3.6.0**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.