enable_testing()

add_executable(htable
  htable.c)

# depending on the framework, you need to link to it
target_link_libraries(htable
  eztrace-core)

target_compile_options(htable
  PRIVATE
    -Wall -Wextra -Wpedantic
    -Werror
)

target_include_directories(htable
  PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}/src/core/include/eztrace-core/
)

add_test(NAME htable COMMAND htable)
set(EZTRACE_LIBRARY_PATH "${CMAKE_BINARY_DIR}/src/eztrace-lib")

# Get the list of tests, and set environment variables
get_property(test_list DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
set_property(TEST ${test_list}
  PROPERTY ENVIRONMENT
  "EZTRACE_LIBRARY_PATH=${EZTRACE_LIBRARY_PATH}"
  ${TEST_ENVIRONMENT}
)

