From bc82a32ba27fe60299b43d6874f2e363c4d85e55 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 29 Oct 2021 16:04:26 +0800 Subject: [PATCH] [td-10564] add test cases. --- source/libs/planner/inc/plannerUtil.h | 29 +++++++++++++++++++++++++ source/libs/planner/src/plannerUtil.c | 6 +++++ source/libs/planner/test/CMakeLists.txt | 18 +++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 source/libs/planner/inc/plannerUtil.h create mode 100644 source/libs/planner/src/plannerUtil.c create mode 100644 source/libs/planner/test/CMakeLists.txt diff --git a/source/libs/planner/inc/plannerUtil.h b/source/libs/planner/inc/plannerUtil.h new file mode 100644 index 0000000000..198c883c5a --- /dev/null +++ b/source/libs/planner/inc/plannerUtil.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_PLANNERUTIL_H +#define TDENGINE_PLANNERUTIL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "parser.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#endif // TDENGINE_PLANNERUTIL_H diff --git a/source/libs/planner/src/plannerUtil.c b/source/libs/planner/src/plannerUtil.c new file mode 100644 index 0000000000..b692fc67c2 --- /dev/null +++ b/source/libs/planner/src/plannerUtil.c @@ -0,0 +1,6 @@ +#include "tvariant.h" +#include "plannerUtil.h" + + + + diff --git a/source/libs/planner/test/CMakeLists.txt b/source/libs/planner/test/CMakeLists.txt new file mode 100644 index 0000000000..a83d7a39d9 --- /dev/null +++ b/source/libs/planner/test/CMakeLists.txt @@ -0,0 +1,18 @@ + +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) + +ADD_EXECUTABLE(plannerTest ${SOURCE_LIST}) +TARGET_LINK_LIBRARIES( + plannerTest + PUBLIC os util common planner parser catalog transport gtest function +) + +TARGET_INCLUDE_DIRECTORIES( + plannerTest + PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/planner/" + PRIVATE "${CMAKE_SOURCE_DIR}/source/libs/planner/inc" +)