google/benchmark

An equivalant to TYPED_TEST from googletest

Open

#541 建立於 2018年3月4日

在 GitHub 查看
 (0 留言) (17 反應) (0 負責人)C++ (1,539 fork)batch import
enhancementhelp wanted

倉庫指標

Star
 (7,968 star)
PR 合併指標
 (平均合併 4天 2小時) (30 天內合併 19 個 PR)

描述

Hi google-benchmark team,

being accustomed to the googletest framework, I'm searching for an utility that matches TYPED_TEST.

I only found BENCHMARK_TEMPLATE, but this will pass all template arguments to just one benchmark. I'm searching for a way to do the same benchmark for a series of single types.

I have to repeat the same definition over and over again, just to benchmark the same thing for multiple types:

BENCHMARK_TEMPLATE(assign_char, gap);
BENCHMARK_TEMPLATE(assign_char, dna4);
BENCHMARK_TEMPLATE(assign_char, dna5);
BENCHMARK_TEMPLATE(assign_char, nucl16);
BENCHMARK_TEMPLATE(assign_char, rna4);
BENCHMARK_TEMPLATE(assign_char, rna5);
BENCHMARK_TEMPLATE(assign_char, char);
BENCHMARK_TEMPLATE(assign_char, union_composition<gap,dna4,dna5,nucl16,rna4,rna5>);

BENCHMARK_TEMPLATE(to_char, gap);
BENCHMARK_TEMPLATE(to_char, dna4);
BENCHMARK_TEMPLATE(to_char, dna5);
BENCHMARK_TEMPLATE(to_char, nucl16);
BENCHMARK_TEMPLATE(to_char, rna4);
BENCHMARK_TEMPLATE(to_char, rna5);
BENCHMARK_TEMPLATE(to_char, char);
BENCHMARK_TEMPLATE(to_char, union_composition<gap,dna4,dna5,nucl16,rna4,rna5>);

It would be nice to have a consistent behaviour between googletest and google/benchmark. Because, they complement each other quite nicely.

Thank you!

貢獻者指南