Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The json reporter does not print results of benchmarks #2879

Open
SimeonEhrig opened this issue Jun 26, 2024 · 4 comments
Open

The json reporter does not print results of benchmarks #2879

SimeonEhrig opened this issue Jun 26, 2024 · 4 comments

Comments

@SimeonEhrig
Copy link

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

Expected result

The xml reporter provides the benchmark results: bench.xml.txt

The json reporter misses the benchmark results: bench.json

Reproduction steps

  1. compile the following code with catch2
  2. run with ./bench -r json > bench.json
#include <catch2/benchmark/catch_benchmark.hpp>
#include <catch2/catch_test_macros.hpp>

#include <cctype>

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
@pavan591-0
Copy link

Hi @SimeonEhrig,

We want to work on this issue as part of our course project. Could you please assign it to me and, if possible, help us generate the issue?

Thank you.

@horenmar
Copy link
Member

horenmar commented Jul 27, 2024

Yeah, JSON reporter is not finished, and any output aside the listings (--list-*) is a WIP skeleton. The reason it is merged is to support work on #2871 (which seems to have gotten stuck somewhere).

@SimeonEhrig
Copy link
Author

Hi @SimeonEhrig,

We want to work on this issue as part of our course project. Could you please assign it to me and, if possible, help us generate the issue?

Thank you.

Thanks. Unfortunately I cannot assign this issue to you, because I'm not a Catch 2 maintainer.
I'm not sure, what you mean with "generate the issue".

@pavan591-0
Copy link

pavan591-0 commented Aug 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants