1 # Copyright (c) PLUMgrid, Inc. 2 # Licensed under the Apache License, Version 2.0 (the "License") 3 4 include_directories(${CMAKE_SOURCE_DIR}/src/cc) 5 include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) 6 7 add_executable(test_static test_static.c) 8 target_link_libraries(test_static bcc-static) 9 10 add_test(NAME c_test_static COMMAND ${TEST_WRAPPER} c_test_static sudo ${CMAKE_CURRENT_BINARY_DIR}/test_static) 11 12 if(ENABLE_USDT) 13 add_executable(test_libbcc 14 test_libbcc.cc 15 test_c_api.cc 16 test_array_table.cc 17 test_bpf_table.cc 18 test_hash_table.cc 19 test_perf_event.cc 20 test_prog_table.cc 21 test_shared_table.cc 22 test_usdt_args.cc 23 test_usdt_probes.cc 24 utils.cc) 25 26 target_link_libraries(test_libbcc bcc-shared dl) 27 add_test(NAME test_libbcc COMMAND ${TEST_WRAPPER} c_test_all sudo ${CMAKE_CURRENT_BINARY_DIR}/test_libbcc) 28 29 find_path(SDT_HEADER NAMES "sys/sdt.h") 30 if (SDT_HEADER) 31 target_compile_definitions(test_libbcc PRIVATE HAVE_SDT_HEADER=1) 32 endif() 33 endif(ENABLE_USDT) 34