Skip to content

thulab/cpp-native-api-testcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cpp-Session-Test说明


一、介绍

本程序是基于开源版IoTDB C++客户端API进行测试的程序

1、目录

├── assert                      // 静态资源目录
├── build                       // 编译和生成可执行文件目录
├── client                      // 头文件和库文件目录
├── test                        // 测试代码目录
|   ├── CMakeLists.txt          // 测试代码目录的配置文件
├── CMakeLists.txt              // 主配置文件
├── CMakePresets.json           // CMake项目构建配置文件
├── compile.sh                  // 编译脚本
├── README.md                   // 程序说明文档
├── run.sh                      // 执行脚本

2、编译

拉取iotdb源码并编译生成c++头文件和库文件

# 拉取
git clone https://github.com/apache/iotdb.git
cd iotdb
# 编译c++(基于Centos7,glibc 版本 >= 2.17 的 Linux,更多平台编译详见IoTDB官网文档:https://iotdb.apache.org/zh/UserGuide/latest/API/Programming-Cpp-Native-API.html#_2-2-%E6%89%A7%E8%A1%8C%E7%BC%96%E8%AF%91)
./mvnw clean package -pl example/client-cpp-example -am -DskipTests -P with-cpp -Diotdb-tools-thrift.version=0.14.1.1-glibc223-SNAPSHOT
# Ubuntu22版本(glibc 版本 >= 2.31):./mvnw clean package -pl example/client-cpp-example -am -DskipTests -P with-cpp -Diotdb-tools-thrift.version=0.14.1.1-old-glibc-SNAPSHOT
# 存放头文件和库文件
头文件位于:iotdb-client/client-cpp/target/client-cpp-*-SNAPSHOT-cpp-linux-x86_64/include下,存放到测试程序根目录的client/include下
库文件位于:iotdb-client/client-cpp/target/client-cpp-*-SNAPSHOT-cpp-linux-x86_64/lib下,存放到测试程序根目录的client/lib下

第一次需要手动编译gtest测试工具生成gtest头文件和库文件,也需要存放到同样地方下


二、使用

在根目录下执行命令

# 编译
./compile.sh
# 执行
./run.sh

成功结果如下图所示

image-20240912111738245

出现错误结果如下图所示

image-20240912111707611

About

Mainly used for testing the functionality, coverage, and performance of Cpp clients

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages