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

feat: benchmark_list_tests benchmark-format=json #1647

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

varshneydevansh
Copy link
Contributor

The basics

  • I branched from the main
  • My pull request is against main
  • My code follows the Google Style Guide
  • I ran clang-format

The details

Resolves

Proposed Changes

To output the benchmark list in JSON format.

Behavior Before Change

Unable to get the desired output for the automation purpose in the JSN format.

Behavior After Change

Added the support for the use of --benchmark_list_tests together with --benchmark-format=json.

Reason for Changes

With this change, the user will be able to get the benchmark output easily in JSON format for better machine use cases.

Test Coverage

I haven't tested this, as soon as I got confirmation that these are the required changes that will update the status of the Test Coverage.

Documentation

Documentation needs to be done for this as it's a feature request once this will pass all the test cases I will add the required document for this.

Additional Information

@varshneydevansh
Copy link
Contributor Author

varshneydevansh commented Aug 12, 2023

Now we have to add the test cases for this enhancement and also have to modify the console menu for this change.

" [--benchmark_list_tests={true|false}]\n"

and also the documentation =)


or maybe we just need to modify the documentations and the test cases?

src/benchmark.cc Outdated Show resolved Hide resolved
src/json_reporter.cc Outdated Show resolved Hide resolved
@@ -164,6 +164,14 @@ class TestReporter : public benchmark::BenchmarkReporter {
for (auto rep : reporters_) rep->Finalize();
}

void List(const std::vector<benchmark::internal::BenchmarkInstance>&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we could have a gtest for the List function?

@varshneydevansh
Copy link
Contributor Author

Apologies, @dmah42 I am currently writing a book on ADHD and I didn't evaluate that it will take this much of time. I am trying to complete it soon and will work on the remaining issues. =)

@dmah42 dmah42 added the incomplete work needed label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete work needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] support flag --benchmark_list_tests work with --benchmark-format=json
2 participants