@@ -55,13 +55,16 @@ foreach(i RANGE ${graphdb_len2})
5555 endif ()
5656
5757 # Combine commands: use bash -c to execute write && read
58- add_test (
59- NAME graphdb-wpa_tests/${filename}
60- COMMAND bash -c
61- "${CMAKE_BINARY_DIR} /bin/${write_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} ' && ${CMAKE_BINARY_DIR} /bin/${read_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} '"
62- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} /bin
63- )
64-
58+ if (TARGET graphdb-wpa)
59+ add_test (
60+ NAME graphdb-wpa_tests/${filename}
61+ COMMAND bash -c
62+ "${CMAKE_BINARY_DIR} /bin/${write_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} ' && ${CMAKE_BINARY_DIR} /bin/${read_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} '"
63+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} /bin
64+ )
65+ else ()
66+ message (WARNING "Skipping graphdb-wpa because binary not found" )
67+ endif ()
6568 endforeach ()
6669endforeach ()
6770
@@ -221,7 +224,7 @@ foreach(file ${diff_tests_cruxbc})
221224 endif ()
222225endforeach ()
223226
224- # graphdb-saber tests (write + read)
227+ # graphdb-saber mem_leak tests (write + read)
225228# Usage: ctest -R graphdb-saber_tests -VV
226229# This test suite runs graphdb-saber on the same mem_leak cases as saber,
227230# executing both write2db and read-from-db phases. A test passes only if both succeed.
@@ -232,12 +235,16 @@ string(REPLACE " " ";" commandtemp ${cmd})
232235set (command ${commandtemp} )
233236# loops over each file creating a test
234237foreach (filename ${mem_leak_files} )
235- add_test (
236- NAME graphdb-saber_tests/${filename}
237- COMMAND bash -c
238- "${CMAKE_BINARY_DIR} /bin/${graphdb_saber_write_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} ' && ${CMAKE_BINARY_DIR} /bin/${graphdb_saber_read_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} '"
239- WORKING_DIRECTORY ${CMAKE_BINARY_DIR} /bin
240- )
238+ if (TARGET graphdb-saber)
239+ add_test (
240+ NAME graphdb-saber_tests/${filename}
241+ COMMAND bash -c
242+ "${CMAKE_BINARY_DIR} /bin/${graphdb_saber_write_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} ' && ${CMAKE_BINARY_DIR} /bin/${graphdb_saber_read_cmd} '${CMAKE_CURRENT_SOURCE_DIR} /${filename} '"
243+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} /bin
244+ )
245+ else ()
246+ message (WARNING "Skipping graphdb-saber because binary not found" )
247+ endif ()
241248endforeach ()
242249
243250# saber mem_leak tests (ctest -R mem_leak -VV)
0 commit comments