提交 c1fd5218 编写于 作者: S slzhou

Merge branch '3.0' of github.com:taosdata/TDengine into szhou/feature/push-project-condition

......@@ -51,6 +51,13 @@ IF(${TD_WINDOWS})
"If build unit tests using googletest"
ON
)
ELSEIF (TD_DARWIN_64)
add_definitions(-DCOMPILER_SUPPORTS_CXX13)
option(
BUILD_TEST
"If build unit tests using googletest"
ON
)
ELSE ()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++13" COMPILER_SUPPORTS_CXX13)
......
......@@ -43,6 +43,9 @@ if (taosInitLog("taosdlog", 1) != 0) {
}
void Testbase::Init(const char* path, int16_t port) {
#ifdef _TD_DARWIN_64
osDefaultInit();
#endif
tsServerPort = port;
strcpy(tsLocalFqdn, "localhost");
snprintf(tsLocalEp, TSDB_EP_LEN, "%s:%u", tsLocalFqdn, tsServerPort);
......
MESSAGE(STATUS "build parser unit test")
# GoogleTest requires at least C++11
SET(CMAKE_CXX_STANDARD 11)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
IF(NOT TD_DARWIN)
# GoogleTest requires at least C++11
SET(CMAKE_CXX_STANDARD 11)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
ADD_EXECUTABLE(executorTest ${SOURCE_LIST})
TARGET_LINK_LIBRARIES(
executorTest
PRIVATE os util common transport gtest taos_static qcom executor function planner scalar nodes vnode
)
ADD_EXECUTABLE(executorTest ${SOURCE_LIST})
TARGET_LINK_LIBRARIES(
executorTest
PRIVATE os util common transport gtest taos_static qcom executor function planner scalar nodes vnode
)
TARGET_INCLUDE_DIRECTORIES(
executorTest
PUBLIC "${TD_SOURCE_DIR}/include/libs/executor/"
PRIVATE "${TD_SOURCE_DIR}/source/libs/executor/inc"
)
TARGET_INCLUDE_DIRECTORIES(
executorTest
PUBLIC "${TD_SOURCE_DIR}/include/libs/executor/"
PRIVATE "${TD_SOURCE_DIR}/source/libs/executor/inc"
)
ENDIF ()
\ No newline at end of file
......@@ -75,6 +75,10 @@ static int32_t udfSpawnUdfd(SUdfdData* pData) {
#ifdef WINDOWS
GetModuleFileName(NULL, path, PATH_MAX);
taosDirName(path);
#elif defined(_TD_DARWIN_64)
uint32_t pathSize = sizeof(path);
_NSGetExecutablePath(path, &pathSize);
taosDirName(path);
#endif
} else {
strncpy(path, tsProcPath, strlen(tsProcPath));
......
add_executable(idxTest "")
add_executable(idxFstTest "")
add_executable(idxFstUT "")
add_executable(idxUtilUT "")
add_executable(idxJsonUT "")
IF(NOT TD_DARWIN)
add_executable(idxTest "")
add_executable(idxFstTest "")
add_executable(idxFstUT "")
add_executable(idxUtilUT "")
add_executable(idxJsonUT "")
target_sources(idxTest
PRIVATE
"indexTests.cc"
)
target_sources(idxFstTest
PRIVATE
"fstTest.cc"
)
target_sources(idxTest
PRIVATE
"indexTests.cc"
)
target_sources(idxFstTest
PRIVATE
"fstTest.cc"
)
target_sources(idxFstUT
PRIVATE
"fstUT.cc"
)
target_sources(idxUtilUT
PRIVATE
"utilUT.cc"
)
target_sources(idxFstUT
PRIVATE
"fstUT.cc"
)
target_sources(idxUtilUT
PRIVATE
"utilUT.cc"
)
target_sources(idxJsonUT
PRIVATE
"jsonUT.cc"
)
target_include_directories (idxTest
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxFstTest
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_sources(idxJsonUT
PRIVATE
"jsonUT.cc"
)
target_include_directories (idxTest
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxFstTest
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxFstUT
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxFstUT
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxUtilUT
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxUtilUT
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_include_directories (idxJsonUT
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_link_libraries (idxTest
os
util
common
gtest_main
index
)
target_link_libraries (idxFstTest
os
util
common
gtest_main
index
)
target_link_libraries (idxFstUT
os
util
common
gtest_main
index
)
target_include_directories (idxJsonUT
PUBLIC
"${TD_SOURCE_DIR}/include/libs/index"
"${CMAKE_CURRENT_SOURCE_DIR}/../inc"
)
target_link_libraries (idxTest
os
util
common
gtest_main
index
)
target_link_libraries (idxFstTest
os
util
common
gtest_main
index
)
target_link_libraries (idxFstUT
os
util
common
gtest_main
index
)
target_link_libraries (idxUtilUT
os
util
common
gtest_main
index
)
target_link_libraries (idxUtilUT
os
util
common
gtest_main
index
)
target_link_libraries (idxJsonUT
os
util
common
gtest_main
index
)
target_link_libraries (idxJsonUT
os
util
common
gtest_main
index
)
add_test(
NAME idxtest
COMMAND idxTest
)
add_test(
NAME idxJsonUT
COMMAND idxJsonUT
)
add_test(
NAME idxUtilUT
COMMAND idxUtilUT
)
add_test(
NAME idxFstUT
COMMAND idxFstUT
)
add_test(
NAME idxtest
COMMAND idxTest
)
add_test(
NAME idxJsonUT
COMMAND idxJsonUT
)
add_test(
NAME idxUtilUT
COMMAND idxUtilUT
)
add_test(
NAME idxFstUT
COMMAND idxFstUT
)
ENDIF ()
\ No newline at end of file
MESSAGE(STATUS "build planner unit test")
# GoogleTest requires at least C++11
SET(CMAKE_CXX_STANDARD 11)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
IF(NOT TD_DARWIN)
# GoogleTest requires at least C++11
SET(CMAKE_CXX_STANDARD 11)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST)
ADD_EXECUTABLE(plannerTest
ADD_EXECUTABLE(plannerTest
${SOURCE_LIST}
"${SOURCE_LIST}/../../../parser/test/mockCatalog.cpp"
"${SOURCE_LIST}/../../../parser/test/mockCatalogService.cpp"
)
)
TARGET_LINK_LIBRARIES(
plannerTest
PUBLIC os util common nodes planner parser catalog transport gtest function qcom
)
TARGET_LINK_LIBRARIES(
plannerTest
PUBLIC os util common nodes planner parser catalog transport gtest function qcom
)
TARGET_INCLUDE_DIRECTORIES(
plannerTest
PUBLIC "${TD_SOURCE_DIR}/include/libs/planner/"
PRIVATE "${TD_SOURCE_DIR}/source/libs/planner/inc"
PRIVATE "${TD_SOURCE_DIR}/source/libs/parser/test"
)
TARGET_INCLUDE_DIRECTORIES(
plannerTest
PUBLIC "${TD_SOURCE_DIR}/include/libs/planner/"
PRIVATE "${TD_SOURCE_DIR}/source/libs/planner/inc"
PRIVATE "${TD_SOURCE_DIR}/source/libs/parser/test"
)
if(${BUILD_WINGETOPT})
target_include_directories(
plannerTest
PUBLIC "${TD_SOURCE_DIR}/contrib/wingetopt/src"
)
target_link_libraries(plannerTest PUBLIC wingetopt)
endif()
if(${BUILD_WINGETOPT})
target_include_directories(
plannerTest
PUBLIC "${TD_SOURCE_DIR}/contrib/wingetopt/src"
)
target_link_libraries(plannerTest PUBLIC wingetopt)
endif()
add_test(
NAME plannerTest
COMMAND plannerTest
)
add_test(
NAME plannerTest
COMMAND plannerTest
)
ENDIF ()
\ No newline at end of file
......@@ -16,7 +16,11 @@
class TfsTest : public ::testing::Test {
protected:
#ifdef _TD_DARWIN_64
static void SetUpTestSuite() { root = "/private" TD_TMP_DIR_PATH "tfsTest"; }
#else
static void SetUpTestSuite() { root = TD_TMP_DIR_PATH "tfsTest"; }
#endif
static void TearDownTestSuite() {}
public:
......@@ -299,6 +303,17 @@ TEST_F(TfsTest, 04_File) {
TEST_F(TfsTest, 05_MultiDisk) {
int32_t code = 0;
#ifdef _TD_DARWIN_64
const char *root00 = "/private" TD_TMP_DIR_PATH "tfsTest00";
const char *root01 = "/private" TD_TMP_DIR_PATH "tfsTest01";
const char *root10 = "/private" TD_TMP_DIR_PATH "tfsTest10";
const char *root11 = "/private" TD_TMP_DIR_PATH "tfsTest11";
const char *root12 = "/private" TD_TMP_DIR_PATH "tfsTest12";
const char *root20 = "/private" TD_TMP_DIR_PATH "tfsTest20";
const char *root21 = "/private" TD_TMP_DIR_PATH "tfsTest21";
const char *root22 = "/private" TD_TMP_DIR_PATH "tfsTest22";
const char *root23 = "/private" TD_TMP_DIR_PATH "tfsTest23";
#else
const char *root00 = TD_TMP_DIR_PATH "tfsTest00";
const char *root01 = TD_TMP_DIR_PATH "tfsTest01";
const char *root10 = TD_TMP_DIR_PATH "tfsTest10";
......@@ -308,6 +323,7 @@ TEST_F(TfsTest, 05_MultiDisk) {
const char *root21 = TD_TMP_DIR_PATH "tfsTest21";
const char *root22 = TD_TMP_DIR_PATH "tfsTest22";
const char *root23 = TD_TMP_DIR_PATH "tfsTest23";
#endif
SDiskCfg dCfg[9] = {0};
tstrncpy(dCfg[0].dir, root01, TSDB_FILENAME_LEN);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册