@@ -1442,14 +1442,27 @@ class Fixture : public internal::Benchmark {
1442
1442
#include < filesystem>
1443
1443
#define CUR_FILE \
1444
1444
std::filesystem::relative (__FILE__, CODSPEED_GIT_ROOT_DIR).string() + "::"
1445
+
1446
+ // Transforms `BM_Foo<int, double>` into `BM_Foo[int, double]`.
1445
1447
#define TYPE_START " ["
1446
1448
#define TYPE_END " ]"
1447
- #define FUNC_TEST_SEP " ::"
1449
+
1450
+ // Transforms `BM_Foo/int_arg` into `BM_Foo[int_arg]`.
1451
+ #define NAME_START " ["
1452
+ #define NAME_END " ]"
1453
+
1454
+ // Extra space after the comma for readability
1455
+ #define COMMA " , "
1448
1456
#else
1449
1457
#define CUR_FILE std::string ()
1458
+
1450
1459
#define TYPE_START " <"
1451
1460
#define TYPE_END " >"
1452
- #define FUNC_TEST_SEP " /"
1461
+
1462
+ #define NAME_START " /"
1463
+ #define NAME_END " "
1464
+
1465
+ #define COMMA " ,"
1453
1466
#endif
1454
1467
1455
1468
#define BENCHMARK (...) \
@@ -1481,7 +1494,7 @@ class Fixture : public internal::Benchmark {
1481
1494
BENCHMARK_PRIVATE_DECLARE (_benchmark_) = \
1482
1495
(::benchmark::internal::RegisterBenchmarkInternal( \
1483
1496
std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1484
- CUR_FILE + #func FUNC_TEST_SEP #test_case_name, \
1497
+ CUR_FILE + #func NAME_START #test_case_name NAME_END, \
1485
1498
[](::benchmark::State& st) { func (st, __VA_ARGS__); })))
1486
1499
1487
1500
// This will register a benchmark for a templatized function. For example:
@@ -1502,7 +1515,7 @@ class Fixture : public internal::Benchmark {
1502
1515
BENCHMARK_PRIVATE_DECLARE (n) = \
1503
1516
(::benchmark::internal::RegisterBenchmarkInternal( \
1504
1517
std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1505
- CUR_FILE + #n TYPE_START #a " , " #b TYPE_END, n<a, b>)))
1518
+ CUR_FILE + #n TYPE_START #a COMMA #b TYPE_END, n<a, b>)))
1506
1519
1507
1520
#define BENCHMARK_TEMPLATE (n, ...) \
1508
1521
BENCHMARK_PRIVATE_DECLARE (n) = \
@@ -1531,13 +1544,22 @@ class Fixture : public internal::Benchmark {
1531
1544
BENCHMARK_CAPTURE (func<a>, test_case_name, __VA_ARGS__)
1532
1545
#endif
1533
1546
1547
+ #ifdef CODSPEED_ENABLED
1548
+ #define BENCHMARK_TEMPLATE2_CAPTURE (func, a, b, test_case_name, ...) \
1549
+ BENCHMARK_PRIVATE_DECLARE (func) = \
1550
+ (::benchmark::internal::RegisterBenchmarkInternal( \
1551
+ std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1552
+ CUR_FILE + #func " [" #test_case_name COMMA #a COMMA #b " ]" , \
1553
+ [](::benchmark::State& st) { func<a, b>(st, __VA_ARGS__); })))
1554
+ #else
1534
1555
#define BENCHMARK_TEMPLATE2_CAPTURE (func, a, b, test_case_name, ...) \
1535
1556
BENCHMARK_PRIVATE_DECLARE (func) = \
1536
1557
(::benchmark::internal::RegisterBenchmarkInternal( \
1537
1558
std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1538
- CUR_FILE + #func TYPE_START #a \
1539
- " , " #b TYPE_END FUNC_TEST_SEP #test_case_name, \
1559
+ #func " < " #a " , " #b " > " \
1560
+ " / " #test_case_name, \
1540
1561
[](::benchmark::State& st) { func<a, b>(st, __VA_ARGS__); })))
1562
+ #endif
1541
1563
1542
1564
#define BENCHMARK_PRIVATE_DECLARE_F (BaseClass, Method ) \
1543
1565
class BaseClass ##_##Method##_Benchmark : public BaseClass { \
@@ -1688,7 +1710,6 @@ struct BENCHMARK_EXPORT SystemInfo {
1688
1710
// which allows individual fields to be modified or cleared before
1689
1711
// building the final name using 'str()'.
1690
1712
struct BENCHMARK_EXPORT BenchmarkName {
1691
- std::string path;
1692
1713
std::string function_name;
1693
1714
std::string args;
1694
1715
std::string min_time;
0 commit comments