diff --git a/.travis.yaml b/.travis.yaml new file mode 100644 index 000000000..6cf9e1cce --- /dev/null +++ b/.travis.yaml @@ -0,0 +1,19 @@ +sudo: require +language: cpp +compiler: gcc + +before_install: + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get update -qq + +install: + - sudo apt-get install -qq g++-5 + - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 90 + +script: + - ./build.sh + - ./travis_qmake_gcc_cpp11_gcov + - ./get_code_cov.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index 57c61ef27..d9b74b77c 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Alibaba Cloud C++ Software Development Kit [中文文档](./README_zh.md) +- [![Build Status](https://travis-ci.org/aliyun/aliyun-openapi-cpp-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-openapi-cpp-sdk) + The Alibaba Cloud C++ Software Development Kit (SDK) allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests. This document introduces how to obtain and call Alibaba Cloud C++ SDK. @@ -64,18 +66,18 @@ int main(int argc, char** argv) request.setPageSize(10); auto outcome = client.describeInstances(request); - if (!outcome.isSuccess()) + if (!outcome.isSuccess()) { // Handle exceptions std::cout << outcome.error().errorCode() << std::endl; AlibabaCloud::ShutdownSdk(); return -1; } - + std::cout << "totalCount: " << outcome.result().getTotalCount() << std::endl; // Close the SDK AlibabaCloud::ShutdownSdk(); return 0; } -``` \ No newline at end of file +``` diff --git a/README_zh.md b/README_zh.md index 689dbfe6b..fa1d8defd 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,5 +1,7 @@ # 阿里云开发者C++工具套件 +- [![Build Status](https://travis-ci.org/aliyun/aliyun-openapi-cpp-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-openapi-cpp-sdk) + 欢迎使用阿里云开发者工具套件(SDK)。 适用于阿里云的 C++ SDK 提供了一组现代化的 C++(C++ 11 或更高版本)接口,让您不用复杂编程即可访问云服务器、云监控等多个阿里云服务。 @@ -100,14 +102,14 @@ int main(int argc, char** argv) request.setPageSize(10); auto outcome = client.describeInstances(request); - if (!outcome.isSuccess()) + if (!outcome.isSuccess()) { // 异常处理 std::cout << outcome.error().errorCode() << std::endl; AlibabaCloud::ShutdownSdk(); return -1; } - + std::cout << "totalCount: " << outcome.result().getTotalCount() << std::endl; // 关闭 SDK