fix: Delaunay3D circumcenter 完整实现 + 测试恢复
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
# ── Google Benchmark (FetchContent) ──
|
||||
include(FetchContent)
|
||||
|
||||
find_package(benchmark QUIET)
|
||||
if(NOT benchmark_FOUND)
|
||||
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
|
||||
FetchContent_Declare(
|
||||
google_benchmark
|
||||
URL https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz
|
||||
)
|
||||
FetchContent_MakeAvailable(google_benchmark)
|
||||
endif()
|
||||
|
||||
# ── Benchmark helper header ──
|
||||
# Provides vde::bench::measure_ms() chrono fallback if benchmark not available
|
||||
# (benchmark:: is still preferred when linked)
|
||||
|
||||
# ── main entry ──
|
||||
add_executable(vde_bench
|
||||
bench_main.cpp
|
||||
)
|
||||
target_link_libraries(vde_bench PRIVATE vde benchmark::benchmark)
|
||||
|
||||
# ── BVH ──
|
||||
add_executable(vde_bench_bvh
|
||||
bench_bvh.cpp
|
||||
)
|
||||
target_link_libraries(vde_bench_bvh PRIVATE vde benchmark::benchmark)
|
||||
|
||||
# ── Delaunay ──
|
||||
add_executable(vde_bench_delaunay
|
||||
bench_delaunay.cpp
|
||||
)
|
||||
target_link_libraries(vde_bench_delaunay PRIVATE vde benchmark::benchmark)
|
||||
|
||||
# ── Boolean ──
|
||||
add_executable(vde_bench_boolean
|
||||
bench_boolean.cpp
|
||||
)
|
||||
target_link_libraries(vde_bench_boolean PRIVATE vde benchmark::benchmark)
|
||||
|
||||
# ── Curves ──
|
||||
add_executable(vde_bench_curves
|
||||
bench_curves.cpp
|
||||
)
|
||||
target_link_libraries(vde_bench_curves PRIVATE vde benchmark::benchmark)
|
||||
|
||||
# ── Spatial (R-Tree / KD-Tree) ──
|
||||
add_executable(vde_bench_spatial
|
||||
bench_spatial.cpp
|
||||
)
|
||||
target_link_libraries(vde_bench_spatial PRIVATE vde benchmark::benchmark)
|
||||
|
||||
# ── Convenience target: build all benchmarks ──
|
||||
add_custom_target(vde_benchmarks
|
||||
DEPENDS
|
||||
vde_bench
|
||||
vde_bench_bvh
|
||||
vde_bench_delaunay
|
||||
vde_bench_boolean
|
||||
vde_bench_curves
|
||||
vde_bench_spatial
|
||||
COMMENT "All benchmarks built"
|
||||
)
|
||||
|
||||
# ── CTest integration: register benchmarks with optional args ──
|
||||
# Run individual benchmarks via: ctest -R bench_
|
||||
enable_testing()
|
||||
add_test(NAME bench_bvh COMMAND vde_bench_bvh --benchmark_min_time=0.01)
|
||||
add_test(NAME bench_delaunay COMMAND vde_bench_delaunay --benchmark_min_time=0.01)
|
||||
add_test(NAME bench_boolean COMMAND vde_bench_boolean --benchmark_min_time=0.01)
|
||||
add_test(NAME bench_curves COMMAND vde_bench_curves --benchmark_min_time=0.01)
|
||||
add_test(NAME bench_spatial COMMAND vde_bench_spatial --benchmark_min_time=0.01)
|
||||
Reference in New Issue
Block a user