@@ -1440,21 +1440,23 @@ class Fixture : public internal::Benchmark {
14401440
14411441#ifdef CODSPEED_ENABLED
14421442#include < filesystem>
1443- #define BENCHMARK (...) \
1444- BENCHMARK_PRIVATE_DECLARE (_benchmark_) = \
1445- (::benchmark::internal::RegisterBenchmarkInternal( \
1446- std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1447- std::filesystem::relative (__FILE__, CODSPEED_GIT_ROOT_DIR) \
1448- .string() + \
1449- "::" + #__VA_ARGS__, \
1450- __VA_ARGS__)))
1443+ #define CUR_FILE \
1444+ std::filesystem::relative (__FILE__, CODSPEED_GIT_ROOT_DIR).string() + "::"
1445+ #define TYPE_START " ["
1446+ #define TYPE_END " ]"
1447+ #define FUNC_TEST_SEP " ::"
14511448#else
1449+ #define CUR_FILE std::string ()
1450+ #define TYPE_START " <"
1451+ #define TYPE_END " >"
1452+ #define FUNC_TEST_SEP " /"
1453+ #endif
1454+
14521455#define BENCHMARK (...) \
14531456 BENCHMARK_PRIVATE_DECLARE (_benchmark_) = \
14541457 (::benchmark::internal::RegisterBenchmarkInternal( \
14551458 std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1456- #__VA_ARGS__, __VA_ARGS__)))
1457- #endif
1459+ CUR_FILE + #__VA_ARGS__, __VA_ARGS__)))
14581460
14591461// Old-style macros
14601462#define BENCHMARK_WITH_ARG (n, a ) BENCHMARK(n)->Arg ((a))
@@ -1479,7 +1481,7 @@ class Fixture : public internal::Benchmark {
14791481 BENCHMARK_PRIVATE_DECLARE (_benchmark_) = \
14801482 (::benchmark::internal::RegisterBenchmarkInternal( \
14811483 std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1482- #func " / " #test_case_name, \
1484+ CUR_FILE + #func FUNC_TEST_SEP #test_case_name, \
14831485 [](::benchmark::State& st) { func (st, __VA_ARGS__); })))
14841486
14851487// This will register a benchmark for a templatized function. For example:
@@ -1494,19 +1496,20 @@ class Fixture : public internal::Benchmark {
14941496 BENCHMARK_PRIVATE_DECLARE (n) = \
14951497 (::benchmark::internal::RegisterBenchmarkInternal( \
14961498 std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1497- #n " < " #a " > " , n<a>)))
1499+ CUR_FILE + #n TYPE_START #a TYPE_END , n<a>)))
14981500
14991501#define BENCHMARK_TEMPLATE2 (n, a, b ) \
15001502 BENCHMARK_PRIVATE_DECLARE (n) = \
15011503 (::benchmark::internal::RegisterBenchmarkInternal( \
15021504 std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1503- #n " < " #a " ," #b " > " , n<a, b>)))
1505+ CUR_FILE + #n TYPE_START #a " ," #b TYPE_END , n<a, b>)))
15041506
15051507#define BENCHMARK_TEMPLATE (n, ...) \
15061508 BENCHMARK_PRIVATE_DECLARE (n) = \
15071509 (::benchmark::internal::RegisterBenchmarkInternal( \
15081510 std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1509- #n " <" #__VA_ARGS__ " >" , n<__VA_ARGS__>)))
1511+ CUR_FILE + #n TYPE_START #__VA_ARGS__ TYPE_END, \
1512+ n<__VA_ARGS__>)))
15101513
15111514// This will register a benchmark for a templatized function,
15121515// with the additional arguments specified by `...`.
@@ -1520,15 +1523,20 @@ class Fixture : public internal::Benchmark {
15201523// /* Registers a benchmark named "BM_takes_args<void>/int_string_test` */
15211524// BENCHMARK_TEMPLATE1_CAPTURE(BM_takes_args, void, int_string_test, 42,
15221525// std::string("abc"));
1526+ #ifdef CODSPEED_ENABLED
1527+ #define BENCHMARK_TEMPLATE1_CAPTURE (func, a, test_case_name, ...) \
1528+ BENCHMARK_CAPTURE (func, test_case_name, __VA_ARGS__)
1529+ #else
15231530#define BENCHMARK_TEMPLATE1_CAPTURE (func, a, test_case_name, ...) \
15241531 BENCHMARK_CAPTURE (func<a>, test_case_name, __VA_ARGS__)
1532+ #endif
15251533
15261534#define BENCHMARK_TEMPLATE2_CAPTURE (func, a, b, test_case_name, ...) \
15271535 BENCHMARK_PRIVATE_DECLARE (func) = \
15281536 (::benchmark::internal::RegisterBenchmarkInternal( \
15291537 std::make_unique<::benchmark::internal::FunctionBenchmark>( \
1530- #func " < " #a " , " #b " > " \
1531- " / " #test_case_name, \
1538+ CUR_FILE + #func TYPE_START #a \
1539+ " , " #b TYPE_END FUNC_TEST_SEP #test_case_name, \
15321540 [](::benchmark::State& st) { func<a, b>(st, __VA_ARGS__); })))
15331541
15341542#define BENCHMARK_PRIVATE_DECLARE_F (BaseClass, Method ) \
@@ -1680,6 +1688,7 @@ struct BENCHMARK_EXPORT SystemInfo {
16801688// which allows individual fields to be modified or cleared before
16811689// building the final name using 'str()'.
16821690struct BENCHMARK_EXPORT BenchmarkName {
1691+ std::string path;
16831692 std::string function_name;
16841693 std::string args;
16851694 std::string min_time;
0 commit comments