Skip to content

Commit ffb35d2

Browse files
chore: test
1 parent 789fb65 commit ffb35d2

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ jobs:
5656
key: ${{ runner.os }}-build-${{ matrix.codspeed-mode }}-${{ hashFiles('**/CMakeLists.txt') }}
5757

5858
- name: Create build directory
59-
run: mkdir examples\google_benchmark_cmake\build
59+
run: |
60+
if (-not (Test-Path examples\google_benchmark_cmake\build)) {
61+
mkdir examples\google_benchmark_cmake\build
62+
}
6063
shell: pwsh
6164

6265
- name: Build benchmark example

core/include/codspeed.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef CODSPEED_H
22
#define CODSPEED_H
33

4+
#include <cstdint>
45
#include <string>
56
#include <vector>
67

@@ -33,7 +34,7 @@ class CodSpeed {
3334
struct RawWalltimeBenchmark {
3435
std::string name;
3536
std::string uri;
36-
long iter_per_round;
37+
int64_t iter_per_round;
3738
double mean_ns;
3839
double median_ns;
3940
double stdev_ns;

core/src/walltime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct BenchmarkStats {
3131
double total_time;
3232
uint64_t iqr_outlier_rounds;
3333
uint64_t stdev_outlier_rounds;
34-
long iter_per_round;
34+
int64_t iter_per_round;
3535
uint64_t warmup_iters;
3636
};
3737

examples/google_benchmark_cmake/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ endif()
1111
# On the small benchmarks of this repo, most of the benches will be optimized out, but this is expected.
1212
set(CMAKE_BUILD_TYPE RelWithDebInfo)
1313

14-
option(BENCHMARK_ENABLE_GTEST_TESTS OFF)
14+
# Disable Google Benchmark tests
15+
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable testing of the benchmark library." FORCE)
16+
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable testing of the benchmark library." FORCE)
1517

1618
FetchContent_Declare(
1719
google_benchmark

google_benchmark/include/benchmark/benchmark.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,16 +1459,27 @@ class Fixture : public internal::Benchmark {
14591459
#define BENCHMARK_PRIVATE_CONCAT_NAME(BaseClass, Method) \
14601460
BaseClass##_##Method##_Benchmark
14611461

1462+
#ifdef _MSC_VER
1463+
#define BENCHMARK_PRIVATE_DECLARE(n) \
1464+
/* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
1465+
static ::benchmark::internal::Benchmark const* const BENCHMARK_PRIVATE_NAME( \
1466+
n)
1467+
#else
14621468
#define BENCHMARK_PRIVATE_DECLARE(n) \
14631469
/* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
14641470
static ::benchmark::internal::Benchmark const* const BENCHMARK_PRIVATE_NAME( \
14651471
n) [[maybe_unused]]
1472+
#endif
14661473

14671474
#ifdef CODSPEED_ENABLED
14681475
#define CUR_FILE \
14691476
codspeed::get_path_relative_to_workspace(__FILE__) + "::"
1477+
#ifdef _MSC_VER
1478+
#define NAMESPACE std::string("")
1479+
#else
14701480
#define NAMESPACE \
14711481
(([]() { return codspeed::extract_lambda_namespace(__PRETTY_FUNCTION__); })())
1482+
#endif
14721483
#define STATIC_NAMESPACE_STRING(name) static std::string name = NAMESPACE;
14731484

14741485
#define FILE_AND_NAMESPACE CUR_FILE + NAMESPACE

0 commit comments

Comments
 (0)