dependencies cleanup

move gmock/gtest to third party

Change-Id: I96b43a3de2b6f2151659a9b2eed27eb58db5ce48
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk 2018-05-09 00:57:07 +02:00
parent 33fee15711
commit 10e5b71111
26 changed files with 45775 additions and 89 deletions

View File

@ -93,24 +93,6 @@ if(MSVC)
string(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASEINTERNAL "${CMAKE_CXX_FLAGS_RELEASEINTERNAL}")
endif(MSVC)
if(NOT GTEST_SRC_DIR)
set(GTEST_SRC_DIR_tmp "${CMAKE_SOURCE_DIR}/../gtest")
get_filename_component(GTEST_SRC_DIR ${GTEST_SRC_DIR_tmp} ABSOLUTE)
set(GMOCK_SRC_DIR_tmp "${CMAKE_SOURCE_DIR}/../gmock")
get_filename_component(GMOCK_SRC_DIR ${GMOCK_SRC_DIR_tmp} ABSOLUTE)
else(NOT GTEST_SRC_DIR)
get_filename_component(GTEST_SRC_DIR ${GTEST_SRC_DIR} ABSOLUTE)
set(GMOCK_SRC_DIR_tmp "${GTEST_SRC_DIR}/../gmock")
get_filename_component(GMOCK_SRC_DIR ${GMOCK_SRC_DIR_tmp} ABSOLUTE)
endif(NOT GTEST_SRC_DIR)
set(GTEST_INCLUDE_DIR "${GTEST_SRC_DIR}/include")
set(GMOCK_INCLUDE_DIR "${GMOCK_SRC_DIR}/include")
message(STATUS "Google Test source dir: ${GTEST_SRC_DIR}")
message(STATUS "Google Mock source dir: ${GMOCK_SRC_DIR}")
add_subdirectory(${GMOCK_SRC_DIR} ${IGDRCL_BINARY_DIR}/gmock)
set_target_properties(gtest PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
set_target_properties(gmock PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(NEO_BITS "64")
set(NEO_ARCH "x64")
@ -280,6 +262,8 @@ else()
message(STATUS "Instrumentation library name: ${INSTRUMENTATION_LIB_NAME}")
endif()
add_subdirectory(third_party/gtest)
add_definitions(-DGMM_OCL)
# We want to organize our IDE targets into folders

View File

@ -19,8 +19,6 @@ You may obtain a copy of the License at: https://opensource.org/licenses/MIT
* GmmLib - https://github.com/intel/gmmlib
* Intel Graphics Compiler - https://github.com/intel/intel-graphics-compiler
* Google Test v1.7.0 - https://github.com/google/googletest
* Google Mock v1.7.0 - https://github.com/google/googlemock
* Khronos OpenCL Headers - https://github.com/KhronosGroup/OpenCL-Headers
## Optional dependencies

View File

@ -23,8 +23,6 @@ sudo /usr/sbin/alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 50
|- llvm_patches https://github.com/intel/llvm-patches
|- llvm_source https://github.com/llvm-mirror/llvm
|- gmmlib https://github.com/intel/gmmlib
|- gmock https://github.com/google/googlemock
|- gtest https://github.com/google/googletest
|- igc https://github.com/intel/intel-graphics-compiler
|- khronos https://github.com/KhronosGroup/OpenCL-Headers
|- neo https://github.com/intel/compute-runtime
@ -38,8 +36,6 @@ git clone https://github.com/intel/opencl-clang common_clang
git clone https://github.com/intel/llvm-patches llvm_patches
git clone -b release_40 https://github.com/llvm-mirror/llvm llvm_source
git clone https://github.com/intel/gmmlib gmmlib
git clone -b release-1.7.0 https://github.com/google/googlemock gmock
git clone -b release-1.7.0 https://github.com/google/googletest gtest
git clone https://github.com/intel/intel-graphics-compiler igc
git clone https://github.com/KhronosGroup/OpenCL-Headers khronos
git clone https://github.com/intel/compute-runtime neo

View File

@ -22,8 +22,6 @@ See [LIMITATIONS.md](https://github.com/intel/compute-runtime/blob/master/docume
|- llvm_patches https://github.com/intel/llvm-patches
|- llvm_source https://github.com/llvm-mirror/llvm
|- gmmlib https://github.com/intel/gmmlib
|- gmock https://github.com/google/googlemock
|- gtest https://github.com/google/googletest
|- igc https://github.com/intel/intel-graphics-compiler
|- khronos https://github.com/KhronosGroup/OpenCL-Headers
|- neo https://github.com/intel/compute-runtime
@ -37,8 +35,6 @@ git clone https://github.com/intel/opencl-clang common_clang
git clone https://github.com/intel/llvm-patches llvm_patches
git clone -b release_40 https://github.com/llvm-mirror/llvm llvm_source
git clone https://github.com/intel/gmmlib gmmlib
git clone -b release-1.7.0 https://github.com/google/googlemock gmock
git clone -b release-1.7.0 https://github.com/google/googletest gtest
git clone https://github.com/intel/intel-graphics-compiler igc
git clone https://github.com/KhronosGroup/OpenCL-Headers khronos
git clone https://github.com/intel/compute-runtime neo

View File

@ -6,20 +6,6 @@ components:
repository: https://github.com/intel/gmmlib.git
revision: a5015343bc932e39747c57ea5dec0cbf28685465
type: git
gmock:
branch: master
clean_on_sync: true
dest_dir: gmock
repository: https://github.com/google/googlemock.git
revision: c440c8fafc6f60301197720617ce64028e09c79d
type: git
gtest:
branch: master
clean_on_sync: true
dest_dir: gtest
repository: https://github.com/google/googletest.git
revision: c99458533a9b4c743ed51537e25989ea55944908
type: git
igc:
branch: igc
clean_on_sync: true
@ -31,7 +17,7 @@ components:
branch: infra
clean_on_sync: true
dest_dir: infra
revision: 3e03c6a5e6a12c1bbf8fd276fc00cd3c5ea806f1
revision: c174a6eaf351ae68abbc285c837ab29c7544fcfc
type: git
internal:
branch: master

3
third_party/.clang-tidy vendored Normal file
View File

@ -0,0 +1,3 @@
---
Checks: '-*'
...

28
third_party/gtest/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,28 @@
# Copyright (c) 2018, Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
add_library(gmock-gtest STATIC
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/gmock-gtest-all.cc
${CMAKE_CURRENT_SOURCE_DIR}/gtest/gtest.h
${CMAKE_CURRENT_SOURCE_DIR}/gmock/gmock.h
)
target_include_directories(gmock-gtest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

21
third_party/gtest/README.md vendored Normal file
View File

@ -0,0 +1,21 @@
# GoogleTest and GoogleMock libraries
Version used 1.7.0
## Generating
To create required files:
* clone version 1.7.0 of googlemock (https://github.com/google/googlemock)
* go to gtest folder
* clone version 1.7.0 of googletest (https://github.com/google/googlemock)
* create output directory and run python script to create fused version
```
git clone -b release-1.7.0 https://github.com/google/googlemock gmock
cd gmock
git clone -b release-1.7.0 https://github.com/google/googletest gtest
cd scripts
mkdir /tmp/out
./fuse_gmock_files.py .. /tmp/out/
```
* output files are stored in /tmp/out

11443
third_party/gtest/gmock-gtest-all.cc vendored Normal file

File diff suppressed because it is too large Load Diff

14198
third_party/gtest/gmock/gmock.h vendored Normal file

File diff suppressed because it is too large Load Diff

20061
third_party/gtest/gtest/gtest.h vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -107,12 +107,10 @@ if(NOT SHOW_VERBOSE_UTESTS_RESULTS)
endif()
target_include_directories(igdrcl_tests PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
${IGDRCL_SOURCE_DIR}/unit_tests/mocks${BRANCH_DIR_SUFFIX}
)
target_link_libraries(igdrcl_tests gtest gmock ${IGDRCL_EXTRA_LIBS})
target_link_libraries(igdrcl_tests gmock-gtest ${IGDRCL_EXTRA_LIBS})
set(BUILT_IN_KERNEL_DIR "${IGDRCL_SOURCE_DIR}/runtime/built_ins")

View File

@ -36,11 +36,6 @@ set_target_properties(igdrcl_aub_tests PROPERTIES FOLDER ${TEST_PROJECTS_FOLDER}
add_custom_target(run_aub_tests)
set_target_properties(run_aub_tests PROPERTIES FOLDER ${TEST_PROJECTS_FOLDER})
target_include_directories(igdrcl_aub_tests PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
if(WIN32)
target_include_directories(igdrcl_aub_tests PRIVATE
${IGDRCL_SOURCE_DIR}/unit_tests/mocks${BRANCH_DIR_SUFFIX}
@ -62,7 +57,7 @@ add_subdirectories()
target_link_libraries(igdrcl_aub_tests igdrcl_mocks)
target_link_libraries(igdrcl_aub_tests ${NEO_MOCKABLE_LIB_NAME})
target_link_libraries(igdrcl_aub_tests igdrcl_mocks)
target_link_libraries(igdrcl_aub_tests gtest gmock ${IGDRCL_EXTRA_LIBS})
target_link_libraries(igdrcl_aub_tests gmock-gtest ${IGDRCL_EXTRA_LIBS})
target_include_directories(igdrcl_aub_tests BEFORE PRIVATE ${IGDRCL_SOURCE_DIR}/unit_tests/gen_common)

View File

@ -45,7 +45,7 @@
#include "unit_tests/mocks/mock_program.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "test.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include <memory>
using namespace OCLRT;

View File

@ -36,7 +36,7 @@
#include "test.h"
#include "runtime/helpers/cache_policy.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
using namespace OCLRT;
@ -294,4 +294,4 @@ TEST(CommandStreamReceiverSimpleTest, givenCSRWithTagAllocationSetWhenGetTagAllo
GraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000);
csr.setTagAllocation(&allocation);
EXPECT_EQ(&allocation, csr.getTagAllocation());
}
}

View File

@ -34,7 +34,7 @@
#include "unit_tests/mocks/mock_context.h"
#include "unit_tests/mocks/mock_program.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
using namespace OCLRT;

View File

@ -30,14 +30,9 @@ set(CLELFLIB_UNIT_TESTS_SRCS
)
add_executable(elflib_tests ${CLELFLIB_UNIT_TESTS_SRCS})
target_link_libraries(elflib_tests gtest elflib)
target_link_libraries(elflib_tests gmock-gtest elflib)
set_property(TARGET elflib_tests APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS})
target_include_directories(elflib_tests PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
if(UNIX)
target_link_libraries(elflib_tests ${IGDRCL_EXTRA_LIBS})
endif()

View File

@ -77,7 +77,7 @@ add_library (igdrcl_libult_cs OBJECT
${IGDRCL_SRCS_LIB_ULT_CS}
)
target_include_directories(igdrcl_libult PRIVATE
${GTEST_INCLUDE_DIR}
$<TARGET_PROPERTY:gmock-gtest,INTERFACE_INCLUDE_DIRECTORIES>
)
set(IGDRCL_SRCS_LIB_ULT_ENV
@ -130,8 +130,7 @@ else()
endif()
target_include_directories(igdrcl_libult_env PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
$<TARGET_PROPERTY:gmock-gtest,INTERFACE_INCLUDE_DIRECTORIES>
${IGDRCL_SOURCE_DIR}/unit_tests/mocks${BRANCH_DIR_SUFFIX}
)

View File

@ -54,12 +54,10 @@ foreach(target_name linux_tests linux_dll_tests)
$<TARGET_OBJECTS:igdrcl_libult>
$<TARGET_OBJECTS:igdrcl_libult_cs>
)
target_link_libraries(igdrcl_${target_name} ${NEO_MOCKABLE_LIB_NAME} igdrcl_mocks ${IGDRCL_EXTRA_LIBS} gtest gmock)
target_link_libraries(igdrcl_${target_name} ${NEO_MOCKABLE_LIB_NAME} igdrcl_mocks ${IGDRCL_EXTRA_LIBS} gmock-gtest)
set_property(TARGET igdrcl_${target_name} APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS})
target_include_directories(igdrcl_${target_name} PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
${IGDRCL_SOURCE_DIR}/unit_tests/gen_common
${IGDRCL_SOURCE_DIR}/runtime/dll/linux/devices${BRANCH_DIR_SUFFIX}
)

View File

@ -79,11 +79,10 @@ add_subdirectories()
add_library(igdrcl_mocks STATIC ${IGDRCL_SRCS_tests_mocks})
add_dependencies(igdrcl_mocks gtest gmock)
# add_dependencies(igdrcl_mocks gmock-gtest)
target_include_directories(igdrcl_mocks PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
$<TARGET_PROPERTY:gmock-gtest,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:${NEO_STATIC_LIB_NAME},INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_definitions(igdrcl_mocks PRIVATE MOCKABLE_VIRTUAL=virtual $<TARGET_PROPERTY:${NEO_STATIC_LIB_NAME},INTERFACE_COMPILE_DEFINITIONS>)

View File

@ -39,14 +39,9 @@ MESSAGE(STATUS "GTest filter for mt tests:" ${GTEST_FILTER} )
target_link_libraries(igdrcl_mt_tests ${TSAN_LIB})
target_link_libraries(igdrcl_mt_tests ${NEO_MOCKABLE_LIB_NAME})
target_link_libraries(igdrcl_mt_tests gtest gmock)
target_link_libraries(igdrcl_mt_tests gmock-gtest)
target_link_libraries(igdrcl_mt_tests igdrcl_mocks ${IGDRCL_EXTRA_LIBS})
target_include_directories(igdrcl_mt_tests PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
option(SHOW_VERBOSE_UTESTS_RESULTS "Use the default/verbose test output" ON)
if(NOT SHOW_VERBOSE_UTESTS_RESULTS)

View File

@ -50,12 +50,10 @@ add_executable(cloc_tests ${IGDRCL_SRCS_offline_compiler_tests})
target_include_directories(cloc_tests PRIVATE
$<TARGET_PROPERTY:cloc,INCLUDE_DIRECTORIES>
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
target_compile_definitions(cloc_tests PUBLIC MOCKABLE_VIRTUAL=virtual $<TARGET_PROPERTY:cloc,INTERFACE_COMPILE_DEFINITIONS>)
target_link_libraries(cloc_tests igdrcl_mocks gtest elflib)
target_link_libraries(cloc_tests igdrcl_mocks gmock-gtest elflib)
if(UNIX)
target_link_libraries(cloc_tests dl pthread)

View File

@ -31,7 +31,7 @@
#include "unit_tests/mocks/mock_graphics_allocation.h"
#include "unit_tests/mocks/mock_kernel.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
using namespace OCLRT;

View File

@ -30,7 +30,7 @@
#include "unit_tests/program/program_tests.h"
#include "unit_tests/program/program_from_binary.h"
#include "test.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include <algorithm>
#include <memory>
#include <string>

View File

@ -26,7 +26,7 @@ add_executable(igdrcl_tbx_tests
$<TARGET_OBJECTS:igdrcl_libult>
)
target_link_libraries(igdrcl_tbx_tests ${NEO_MOCKABLE_LIB_NAME} igdrcl_mocks gtest gmock ${IGDRCL_EXTRA_LIBS})
target_link_libraries(igdrcl_tbx_tests ${NEO_MOCKABLE_LIB_NAME} igdrcl_mocks gmock-gtest ${IGDRCL_EXTRA_LIBS})
if(WIN32)
target_include_directories(igdrcl_tbx_tests PRIVATE
@ -45,11 +45,6 @@ else()
)
endif()
target_include_directories(igdrcl_tbx_tests PRIVATE
${GTEST_INCLUDE_DIR}
${GMOCK_INCLUDE_DIR}
)
create_project_source_tree(igdrcl_tbx_tests ${IGDRCL_SOURCE_DIR}/runtime ${IGDRCL_SOURCE_DIR}/unit_tests)
add_custom_target(run_tbx_tests ALL DEPENDS unit_tests igdrcl_tbx_tests)

View File

@ -26,7 +26,7 @@
#include "runtime/utilities/stackvec.h"
#include "unit_tests/utilities/containers_tests_helpers.h"
#include "gmock/gmock-matchers.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cinttypes>