Commit 9e6d67f2 authored by Yixing Lao's avatar Yixing Lao Committed by Robert Kimball

Expose ngraph unit test util as a library (#980)

* create ngraph_test_util

* installs libngraph_test_util
parent 22ea1f95
...@@ -238,8 +238,8 @@ if (NGRAPH_UNIT_TEST_ENABLE) ...@@ -238,8 +238,8 @@ if (NGRAPH_UNIT_TEST_ENABLE)
add_subdirectory(test) add_subdirectory(test)
message(STATUS "unit tests enabled") message(STATUS "unit tests enabled")
else() else()
add_subdirectory(test/util)
message(STATUS "unit tests disabled") message(STATUS "unit tests disabled")
endif() endif()
add_subdirectory(doc) add_subdirectory(doc)
...@@ -20,10 +20,6 @@ include_directories( ...@@ -20,10 +20,6 @@ include_directories(
${EIGEN_INCLUDE_DIR} ${EIGEN_INCLUDE_DIR}
) )
include_directories(
${NGRAPH_INCLUDE_DIR}
)
set (SRC set (SRC
backend_api.cpp backend_api.cpp
algebraic_simplification.cpp algebraic_simplification.cpp
...@@ -51,9 +47,6 @@ set (SRC ...@@ -51,9 +47,6 @@ set (SRC
reshape_elimination.cpp reshape_elimination.cpp
tensor.cpp tensor.cpp
type_prop.cpp type_prop.cpp
util/autodiff/backprop_function.cpp
util/test_tools.cpp
util/benchmark.cpp
util.cpp util.cpp
uuid.cpp uuid.cpp
zero_dim_tensor_elimination.cpp zero_dim_tensor_elimination.cpp
...@@ -61,6 +54,7 @@ set (SRC ...@@ -61,6 +54,7 @@ set (SRC
add_subdirectory(models) add_subdirectory(models)
add_subdirectory(files) add_subdirectory(files)
add_subdirectory(util)
#================================================================================================ #================================================================================================
# To auto generate a suite of unit tests for a backend add a line like this # To auto generate a suite of unit tests for a backend add a line like this
...@@ -151,6 +145,8 @@ if(NGRAPH_ADDRESS_SANITIZER) ...@@ -151,6 +145,8 @@ if(NGRAPH_ADDRESS_SANITIZER)
endif() endif()
add_executable(unit-test ${SRC}) add_executable(unit-test ${SRC})
target_link_libraries(unit-test ngraph_test_util)
add_dependencies(unit-test ngraph_test_util)
if(MPI_C_INCLUDE_PATH) if(MPI_C_INCLUDE_PATH)
target_link_libraries(unit-test ${MPI_CXX_LIBRARIES}) target_link_libraries(unit-test ${MPI_CXX_LIBRARIES})
......
# ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
set (SRC
autodiff/backprop_function.cpp
test_tools.cpp
benchmark.cpp
)
include_directories(
${NGRAPH_INCLUDE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/..
)
add_library(ngraph_test_util SHARED ${SRC})
install(TARGETS ngraph_test_util DESTINATION ${NGRAPH_INSTALL_LIB})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment