Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contextual-classifier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if(FLORET_FOUND)

target_link_libraries(ml_inference_lib PRIVATE ${FLORET_LIBRARIES})
target_link_libraries(ContextualClassifier PRIVATE ml_inference_lib)
target_link_libraries(ContextualClassifier PRIVATE RestuneCore)

target_include_directories(ml_inference_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Include)
target_include_directories(ml_inference_lib PRIVATE ${FLORET_INCLUDE_DIRS})
Expand Down
73 changes: 58 additions & 15 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ if(BUILD_TESTS)
install(TARGETS UrmTestPlugin DESTINATION ${CMAKE_INSTALL_LIBDIR}/urm)

add_executable(
RestuneComponentTests
${CMAKE_CURRENT_SOURCE_DIR}/Component/ParserTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/ExtensionIntfTests.cpp
UrmComponentTests
${CMAKE_CURRENT_SOURCE_DIR}/Component/MemoryPoolTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/ClientDataManagerTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/ParserTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/ExtensionIntfTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/MiscTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/RequestQueueTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/ThreadPoolTests.cpp
Expand All @@ -46,19 +46,62 @@ if(BUILD_TESTS)
# ${CMAKE_CURRENT_SOURCE_DIR}/Component/RequestMapTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Component/Trigger.cpp)

target_link_libraries(RestuneComponentTests PUBLIC UrmAuxUtils
UrmExtAPIs
RestuneCore
RestuneTestUtils)
target_link_libraries(UrmComponentTests PUBLIC UrmAuxUtils
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to add build gates so that only resource-tuner tests are built if classifier is not enabled

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

UrmExtAPIs
RestuneCore
RestuneTestUtils
${LIBYAML_LIBRARIES})
target_include_directories(UrmComponentTests PRIVATE ${LIBYAML_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/resource-tuner/Include
${CMAKE_SOURCE_DIR}/common/Include)

if(BUILD_CLASSIFIER)
set(FLORET_FOUND FALSE)
set(FLORET_LIBRARIES "")
set(FLORET_INCLUDE_DIRS "")

if(ENABLE_FLORET)
# Use pkg-config to find floret
pkg_check_modules(PC_FLORET QUIET floret)
if(PC_FLORET_FOUND)
set(FLORET_FOUND TRUE)
set(FLORET_LIBRARIES ${PC_FLORET_LIBRARIES})
set(FLORET_INCLUDE_DIRS ${PC_FLORET_INCLUDE_DIRS})
endif()
endif()

if(FLORET_FOUND)
message(STATUS "floret found, building MLInference with USE_FLORET=1")
add_definitions(-DUSE_FLORET=1)

target_sources(UrmComponentTests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Component/ContextClassificationTest.cpp)

target_link_libraries(UrmComponentTests PUBLIC ContextualClassifier
ml_inference_lib)

target_include_directories(UrmComponentTests PRIVATE
${CMAKE_SOURCE_DIR}/contextual-classifier/Include)
else()
message(STATUS "floret not found")
endif()
endif()

install(TARGETS UrmComponentTests DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(UrmIntegrationTests Integration/IntegrationTests.cpp)

target_link_libraries(UrmIntegrationTests PUBLIC UrmAuxUtils
UrmClient
RestuneTestUtils
${LIBYAML_LIBRARIES})
target_include_directories(UrmIntegrationTests PRIVATE ${LIBYAML_INCLUDE_DIRS})

install(TARGETS RestuneComponentTests DESTINATION ${CMAKE_INSTALL_BINDIR})
if(BUILD_CLASSIFIER)
target_sources(UrmIntegrationTests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Integration/CCIntegrationTest.cpp)
endif()

add_executable(RestuneIntegrationTests Integration/IntegrationTests.cpp)
target_link_libraries(RestuneIntegrationTests PUBLIC UrmAuxUtils
UrmClient
RestuneTestUtils
${LIBYAML_LIBRARIES})
target_include_directories(RestuneIntegrationTests PRIVATE ${LIBYAML_INCLUDE_DIRS})
install(TARGETS RestuneIntegrationTests RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS UrmIntegrationTests RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

endif()
Loading