Repository: hadoop Updated Branches: refs/heads/HADOOP-10388 81e87f34b -> 826a41444
http://git-wip-us.apache.org/repos/asf/hadoop/blob/826a4144/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/CMakeLists.txt new file mode 100644 index 0000000..b8cca0b --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/CMakeLists.txt @@ -0,0 +1,61 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +SET(TEST_WORKING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data/) +ADD_DEFINITIONS(-DGTEST_LANG_CXX11=0 -Dprivate=public -Dprotected=public -DDATA_DIR="${TEST_WORKING_DIR}/") + +ADD_SUBDIRECTORY(function) +ADD_SUBDIRECTORY(unit) +ADD_SUBDIRECTORY(secure) + +IF(TEST_RUNNER) + SEPARATE_ARGUMENTS(TEST_RUNNER_LIST UNIX_COMMAND ${TEST_RUNNER}) +ENDIF(TEST_RUNNER) + +ADD_CUSTOM_TARGET(unittest + COMMAND ${TEST_RUNNER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/unit/unit + DEPENDS unit + WORKING_DIRECTORY ${TEST_WORKING_DIR} + COMMENT "Run Unit Test..." +) + +ADD_CUSTOM_TARGET(functiontest + COMMAND ${TEST_RUNNER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/function/function + DEPENDS function + WORKING_DIRECTORY ${TEST_WORKING_DIR} + COMMENT "Run Function Test..." +) + +ADD_CUSTOM_TARGET(securetest + COMMAND ${TEST_RUNNER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/secure/secure + DEPENDS secure + WORKING_DIRECTORY ${TEST_WORKING_DIR} + COMMENT "Run Security Function Test..." +) + +ADD_CUSTOM_TARGET(test + COMMAND ${CMAKE_MAKE_PROGRAM} unittest || true + COMMAND ${CMAKE_MAKE_PROGRAM} functiontest || true + COMMENT "Run All Test..." +) + +SET(unit_SOURCES ${unit_SOURCES} PARENT_SCOPE) +SET(function_SOURCES ${function_SOURCES} PARENT_SCOPE) +SET(secure_SOURCES ${secure_SOURCES} PARENT_SCOPE) http://git-wip-us.apache.org/repos/asf/hadoop/blob/826a4144/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/function/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/function/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/function/CMakeLists.txt new file mode 100644 index 0000000..b594b6e --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/function/CMakeLists.txt @@ -0,0 +1,86 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +AUTO_SOURCES(function_SOURCES "*.cc" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}") + +INCLUDE_DIRECTORIES(${gmock_INCLUDE_DIR} ${gtest_INCLUDE_DIR} ${libhdfs3_ROOT_SOURCES_DIR}) + +IF(NEED_BOOST) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) +ENDIF(NEED_BOOST) + +INCLUDE_DIRECTORIES(${libhdfs3_ROOT_SOURCES_DIR}) +INCLUDE_DIRECTORIES(${libhdfs3_COMMON_SOURCES_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${libhdfs3_PLATFORM_HEADER_DIR}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${KERBEROS_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${GSASL_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/mock) + +#PROTOBUF_GENERATE_CPP(libhdfs3_PROTO_SOURCES libhdfs3_PROTO_HEADERS ${libhdfs3_PROTO_FILES}) + +IF(ENABLE_DEBUG STREQUAL ON) + SET(libhdfs3_SOURCES ${libhdfs3_SOURCES} ${libhdfs3_MOCK_SOURCES}) +ENDIF(ENABLE_DEBUG STREQUAL ON) + +IF(NOT HDFS_SUPERUSER) + SET(HDFS_SUPERUSER $ENV{USER}) +ENDIF(NOT HDFS_SUPERUSER) + +ADD_DEFINITIONS(-DHDFS_SUPERUSER="${HDFS_SUPERUSER}") +ADD_DEFINITIONS(-DUSER="$ENV{USER}") + +ADD_EXECUTABLE(function EXCLUDE_FROM_ALL + ${gtest_SOURCES} + ${gmock_SOURCES} + ${libhdfs3_SOURCES} + ${libhdfs3_PROTO_SOURCES} + ${libhdfs3_PROTO_HEADERS} + ${function_SOURCES} +) + +TARGET_LINK_LIBRARIES(function pthread) + +IF(NEED_BOOST) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${Boost_LIBRARY_DIRS}") + TARGET_LINK_LIBRARIES(function boost_thread) + TARGET_LINK_LIBRARIES(function boost_chrono) + TARGET_LINK_LIBRARIES(function boost_system) + TARGET_LINK_LIBRARIES(function boost_atomic) + TARGET_LINK_LIBRARIES(function boost_iostreams) +ENDIF(NEED_BOOST) + +IF(NEED_GCCEH) + TARGET_LINK_LIBRARIES(function gcc_eh) +ENDIF(NEED_GCCEH) + +IF(OS_LINUX) + TARGET_LINK_LIBRARIES(function uuid) +ENDIF(OS_LINUX) + +TARGET_LINK_LIBRARIES(function ${PROTOBUF_LIBRARIES}) +TARGET_LINK_LIBRARIES(function ${LIBXML2_LIBRARIES}) +TARGET_LINK_LIBRARIES(function ${KERBEROS_LIBRARIES}) +TARGET_LINK_LIBRARIES(function ${GSASL_LIBRARIES}) + +SET(function_SOURCES ${function_SOURCES} PARENT_SCOPE) http://git-wip-us.apache.org/repos/asf/hadoop/blob/826a4144/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/secure/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/secure/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/secure/CMakeLists.txt new file mode 100644 index 0000000..ab5f758 --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/secure/CMakeLists.txt @@ -0,0 +1,87 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +AUTO_SOURCES(secure_SOURCES "*.cc" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}") + +INCLUDE_DIRECTORIES(${gmock_INCLUDE_DIR} ${gtest_INCLUDE_DIR} ${libhdfs3_ROOT_SOURCES_DIR}) + +IF(NEED_BOOST) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) +ENDIF(NEED_BOOST) + +INCLUDE_DIRECTORIES(${libhdfs3_ROOT_SOURCES_DIR}) +INCLUDE_DIRECTORIES(${libhdfs3_COMMON_SOURCES_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${libhdfs3_PLATFORM_HEADER_DIR}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${KERBEROS_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${GSASL_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/mock) + +#PROTOBUF_GENERATE_CPP(libhdfs3_PROTO_SOURCES libhdfs3_PROTO_HEADERS ${libhdfs3_PROTO_FILES}) + +IF(ENABLE_DEBUG STREQUAL ON) + SET(libhdfs3_SOURCES ${libhdfs3_SOURCES} ${libhdfs3_MOCK_SOURCES}) +ENDIF(ENABLE_DEBUG STREQUAL ON) + +IF(NOT HDFS_SUPERUSER) + SET(HDFS_SUPERUSER $ENV{USER}) +ENDIF(NOT HDFS_SUPERUSER) + +ADD_DEFINITIONS(-DHDFS_SUPERUSER="${HDFS_SUPERUSER}") +ADD_DEFINITIONS(-DUSER="$ENV{USER}") + +ADD_EXECUTABLE(secure EXCLUDE_FROM_ALL + ${gtest_SOURCES} + ${gmock_SOURCES} + ${libhdfs3_SOURCES} + ${libhdfs3_PROTO_SOURCES} + ${libhdfs3_PROTO_HEADERS} + ${secure_SOURCES} +) + +TARGET_LINK_LIBRARIES(secure pthread) + +IF(NEED_BOOST) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${Boost_LIBRARY_DIRS}") + TARGET_LINK_LIBRARIES(secure boost_thread) + TARGET_LINK_LIBRARIES(secure boost_chrono) + TARGET_LINK_LIBRARIES(secure boost_system) + TARGET_LINK_LIBRARIES(secure boost_atomic) + TARGET_LINK_LIBRARIES(secure boost_iostreams) +ENDIF(NEED_BOOST) + +IF(NEED_GCCEH) + TARGET_LINK_LIBRARIES(secure gcc_eh) +ENDIF(NEED_GCCEH) + +IF(OS_LINUX) + TARGET_LINK_LIBRARIES(secure uuid) +ENDIF(OS_LINUX) + +TARGET_LINK_LIBRARIES(secure ${PROTOBUF_LIBRARIES}) +TARGET_LINK_LIBRARIES(secure ${LIBXML2_LIBRARIES}) +TARGET_LINK_LIBRARIES(secure ${KERBEROS_LIBRARIES}) +TARGET_LINK_LIBRARIES(secure ${GSASL_LIBRARIES}) + +SET(secure_SOURCES ${secure_SOURCES} PARENT_SCOPE) + http://git-wip-us.apache.org/repos/asf/hadoop/blob/826a4144/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/unit/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/unit/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/unit/CMakeLists.txt new file mode 100644 index 0000000..a3e0e2f --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/libhdfs3/test/unit/CMakeLists.txt @@ -0,0 +1,81 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +AUTO_SOURCES(unit_SOURCES "*.cc" "RECURSE" ${CMAKE_CURRENT_SOURCE_DIR}) + +INCLUDE_DIRECTORIES(${gmock_INCLUDE_DIR} ${gtest_INCLUDE_DIR} ${libhdfs3_ROOT_SOURCES_DIR}) + +IF(NEED_BOOST) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) +ENDIF(NEED_BOOST) + +INCLUDE_DIRECTORIES(${libhdfs3_ROOT_SOURCES_DIR}) +INCLUDE_DIRECTORIES(${libhdfs3_COMMON_SOURCES_DIR}) +INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +INCLUDE_DIRECTORIES(${libhdfs3_PLATFORM_HEADER_DIR}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${KERBEROS_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${GSASL_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/mock) + +ADD_DEFINITIONS(-DMOCK) + +#PROTOBUF_GENERATE_CPP(libhdfs3_PROTO_SOURCES libhdfs3_PROTO_HEADERS ${libhdfs3_PROTO_FILES}) + +SET(libhdfs3_SOURCES ${libhdfs3_SOURCES} ${libhdfs3_MOCK_SOURCES}) + +ADD_EXECUTABLE(unit EXCLUDE_FROM_ALL + ${gtest_SOURCES} + ${gmock_SOURCES} + ${libhdfs3_SOURCES} + ${libhdfs3_PROTO_SOURCES} + ${libhdfs3_PROTO_HEADERS} + ${unit_SOURCES} +) + +TARGET_LINK_LIBRARIES(unit pthread) + +IF(NEED_BOOST) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${Boost_LIBRARY_DIRS}") + TARGET_LINK_LIBRARIES(unit boost_thread) + TARGET_LINK_LIBRARIES(unit boost_chrono) + TARGET_LINK_LIBRARIES(unit boost_system) + TARGET_LINK_LIBRARIES(unit boost_atomic) + TARGET_LINK_LIBRARIES(unit boost_iostreams) +ENDIF(NEED_BOOST) + +IF(NEED_GCCEH) + TARGET_LINK_LIBRARIES(unit gcc_eh) +ENDIF(NEED_GCCEH) + +IF(OS_LINUX) + TARGET_LINK_LIBRARIES(unit uuid) +ENDIF(OS_LINUX) + +TARGET_LINK_LIBRARIES(unit ${PROTOBUF_LIBRARIES}) +TARGET_LINK_LIBRARIES(unit ${LIBXML2_LIBRARIES}) +TARGET_LINK_LIBRARIES(unit ${KERBEROS_LIBRARIES}) +TARGET_LINK_LIBRARIES(unit ${GSASL_LIBRARIES}) + +SET(unit_SOURCES ${unit_SOURCES} PARENT_SCOPE) +