• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) PLUMgrid, Inc.
2# Licensed under the Apache License, Version 2.0 (the "License")
3
4include_directories(${CMAKE_SOURCE_DIR}/src/cc)
5include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
6
7add_executable(test_static test_static.c)
8target_link_libraries(test_static bcc-static)
9
10add_test(NAME c_test_static COMMAND ${TEST_WRAPPER} c_test_static sudo ${CMAKE_CURRENT_BINARY_DIR}/test_static)
11
12if(ENABLE_USDT)
13add_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
26target_link_libraries(test_libbcc bcc-shared dl)
27add_test(NAME test_libbcc COMMAND ${TEST_WRAPPER} c_test_all sudo ${CMAKE_CURRENT_BINARY_DIR}/test_libbcc)
28
29find_path(SDT_HEADER NAMES "sys/sdt.h")
30if (SDT_HEADER)
31	target_compile_definitions(test_libbcc PRIVATE HAVE_SDT_HEADER=1)
32endif()
33endif(ENABLE_USDT)
34