Skip to content

feat: add support for fixtures #7

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

not-matthias
Copy link
Member

@not-matthias not-matthias commented Mar 14, 2025

Normal output:

MyFixture/FooTest                                   0.000 ns        0.000 ns   1000000000000
MyFixture/BarTest                                   0.000 ns        0.000 ns   1000000000000
MyTemplatedFixture<int>/IntTest                     0.000 ns        0.000 ns   1000000000000
MyTemplatedFixture<double>/DoubleTest               0.000 ns        0.000 ns   1000000000000
MyTemplate1<int>/TestA                              0.000 ns        0.000 ns   1000000000000
MyTemplate2<int,double>/TestB                       0.000 ns        0.000 ns   1000000000000

Output with instrumentation enabled:

Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyFixture[FooTest]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyFixture[BarTest]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplatedFixture[IntTest, int]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplatedFixture[DoubleTest, double]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplate1[TestA, int]
Checked: examples/google_benchmark/fixture_bench.hpp::example_namespace::MyTemplate2[TestB, int, double]

Minor detail: Should the format be MyFixture[TestA] or TestA[MyFixture]. Both make sense imo.

Copy link

codspeed-hq bot commented Mar 14, 2025

CodSpeed Instrumentation Performance Report

Merging #7 will not alter performance

Comparing cod-668-support-fixtures-in-google-benchmark (772a2db) with main (1dda619)

Summary

✅ 15 untouched benchmarks
🆕 6 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 BarTest[MyFixture] N/A 6.2 µs N/A
🆕 DoubleTest[MyTemplatedFixture, double] N/A 6.3 µs N/A
🆕 FooTest[MyFixture] N/A 6.3 µs N/A
🆕 IntTest[MyTemplatedFixture, int] N/A 6.3 µs N/A
🆕 TestA[MyTemplate1, int] N/A 6.3 µs N/A
🆕 TestB[MyTemplate2, int, double] N/A 6.3 µs N/A

Copy link

codspeed-hq bot commented Mar 14, 2025

CodSpeed Walltime Performance Report

Merging #7 will not alter performance

Comparing cod-668-support-fixtures-in-google-benchmark (772a2db) with main (1dda619)

Summary

✅ 15 untouched benchmarks
🆕 6 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 BarTest[MyFixture] N/A 3.6 ns N/A
🆕 DoubleTest[MyTemplatedFixture, double] N/A 3.8 ns N/A
🆕 FooTest[MyFixture] N/A 3.8 ns N/A
🆕 IntTest[MyTemplatedFixture, int] N/A 3.7 ns N/A
🆕 TestA[MyTemplate1, int] N/A 3.8 ns N/A
🆕 TestB[MyTemplate2, int, double] N/A 3.6 ns N/A

Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

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

olgtm, let's go with test[fixture] as discussed in person

@not-matthias not-matthias force-pushed the cod-668-support-fixtures-in-google-benchmark branch from 0e0dd66 to 772a2db Compare March 14, 2025 17:10
Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

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

lgtm

@not-matthias not-matthias merged commit 772a2db into main Mar 17, 2025
5 checks passed
@not-matthias not-matthias deleted the cod-668-support-fixtures-in-google-benchmark branch March 17, 2025 09:06
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

Successfully merging this pull request may close these issues.

2 participants