if(NOT ${CHEMKIT_BUILD_TESTS})
  return()
endif()

macro(add_chemkit_test test_name test_executable)
  add_test(${test_name} ${test_executable})
  set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "CHEMKIT_PLUGIN_PATH=${CMAKE_BINARY_DIR}/lib/chemkit/plugins/")
endmacro(add_chemkit_test)

add_subdirectory(auto)
add_subdirectory(benchmarks)
add_subdirectory(manual)

# copy test data directory
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

if(NOT ${CHEMKIT_BUILD_TESTS})
  return()
endif()

macro(add_chemkit_test test_name test_executable)
  add_test(NAME ${test_name} COMMAND ${test_executable})
  set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "CHEMKIT_PLUGIN_PATH=${CMAKE_BINARY_DIR}/lib/chemkit/plugins/")
endmacro(add_chemkit_test)

add_subdirectory(auto)
add_subdirectory(benchmarks)
add_subdirectory(manual)

# copy test data directory
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

Use the add_test() function with NAME and COMMAND
Use the add_test() function with NAME and COMMAND

This changes the call to add_test() to use the new version
with NAME and COMMAND arguments. This fixes issues where the
tests could not be found and thus were not being run.

Change-Id: Iea2152fce50023c0a4ad025a878d2a147018048a
