Skip to content

Commit d67071f

Browse files
committed
test: Make benchmark compilation optional
Made benchmark subdirectory conditional based on OpenPFC_BUILD_BENCHMARKS option (default: OFF). Benchmarks can take significant time to run and are not needed for regular development testing. Enable benchmarks with: cmake -DOpenPFC_BUILD_BENCHMARKS=ON This speeds up normal test runs from ~10+ seconds to <1 second while still allowing benchmarks when explicitly requested.
1 parent f3c20e1 commit d67071f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ target_include_directories(openpfc-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
1414
# Add test subdirectories (they will add their sources via target_sources)
1515
add_subdirectory(unit)
1616
add_subdirectory(integration)
17-
add_subdirectory(benchmarks)
17+
18+
# Benchmarks are optional (can be slow)
19+
if(OpenPFC_BUILD_BENCHMARKS)
20+
message(STATUS "⏱️ Including performance benchmarks in test suite")
21+
add_subdirectory(benchmarks)
22+
else()
23+
message(STATUS "⏭️ Skipping performance benchmarks (enable with -DOpenPFC_BUILD_BENCHMARKS=ON)")
24+
endif()
1825

1926
# Link against OpenPFC and Catch2
2027
target_link_libraries(openpfc-tests PRIVATE OpenPFC Catch2::Catch2)

0 commit comments

Comments
 (0)