From 919f98cbdd85ddf913fdf7105f68167dd4ca3af4 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Thu, 10 Jan 2019 15:59:00 +0800 Subject: [PATCH] fix travis config * fix travis config * remove the useless files --- .travis.yaml => .travis.yml | 1 + CMakeLists.txt | 2 +- core-tests/CMakeLists.txt | 25 --------------- core-tests/httpmessage.cc | 33 ------------------- core-tests/main.cc | 18 ----------- core-tests/signer.cc | 31 ------------------ core-tests/url.cc | 63 ------------------------------------- core/src/CurlHttpClient.cc | 6 ++-- 8 files changed, 5 insertions(+), 174 deletions(-) rename .travis.yaml => .travis.yml (97%) delete mode 100644 core-tests/CMakeLists.txt delete mode 100644 core-tests/httpmessage.cc delete mode 100644 core-tests/main.cc delete mode 100644 core-tests/signer.cc delete mode 100644 core-tests/url.cc diff --git a/.travis.yaml b/.travis.yml similarity index 97% rename from .travis.yaml rename to .travis.yml index 6cf9e1cce..b77cda4d8 100644 --- a/.travis.yaml +++ b/.travis.yml @@ -11,6 +11,7 @@ install: - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 90 script: + - cmake . - ./build.sh - ./travis_qmake_gcc_cpp11_gcov - ./get_code_cov.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 22bb27c1d..871e64342 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,4 +93,4 @@ add_subdirectory(ccs) add_subdirectory(saf) add_subdirectory(arms) add_subdirectory(lubancloud) -add_subdirectory(alimt) \ No newline at end of file +add_subdirectory(alimt) diff --git a/core-tests/CMakeLists.txt b/core-tests/CMakeLists.txt deleted file mode 100644 index fb89aeffd..000000000 --- a/core-tests/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -add_executable(core-tests - main.cc - httpmessage.cc - signer.cc - url.cc ) - -set_target_properties(core-tests - PROPERTIES - OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}core-tests - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - -target_link_libraries(core-tests - core - ) - -ExternalProject_Get_Property(catch INSTALL_DIR) -set(catch_install_dir ${INSTALL_DIR}) -add_dependencies(core-tests catch) - -target_include_directories(core-tests - PRIVATE ${catch_install_dir} - ${CMAKE_SOURCE_DIR}/core/include - ) - -add_test(NAME core-tests COMMAND core-tests) diff --git a/core-tests/httpmessage.cc b/core-tests/httpmessage.cc deleted file mode 100644 index e81867584..000000000 --- a/core-tests/httpmessage.cc +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Copyright 2009-2017 Alibaba Cloud All rights reserved. -* -* Licensed 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. -*/ - -#include -#include - -using namespace AlibabaCloud; - -TEST_CASE("testHttpMessage") -{ - const std::string data = "Thu, 19 Oct 2017 04:38:27 GMT"; - HttpRequest r; - r.setHeader("accept", "application/xml"); - r.setHeader("Accept", "application/json"); - r.setHeader("Date", data); - - REQUIRE(r.headers().size() == 2); - REQUIRE(r.header("accept") == "application/json"); - REQUIRE(r.header(HttpMessage::KnownHeader::Date) == data); -} \ No newline at end of file diff --git a/core-tests/main.cc b/core-tests/main.cc deleted file mode 100644 index bf7bb139c..000000000 --- a/core-tests/main.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright 2009-2017 Alibaba Cloud All rights reserved. -* -* Licensed 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. -*/ - -#define CATCH_CONFIG_MAIN -#include diff --git a/core-tests/signer.cc b/core-tests/signer.cc deleted file mode 100644 index 500cf312d..000000000 --- a/core-tests/signer.cc +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Copyright 2009-2017 Alibaba Cloud All rights reserved. -* -* Licensed 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. -*/ - -#include -#include - -using namespace AlibabaCloud; - -TEST_CASE("testHmacSha1Signer") -{ - HmacSha1Signer sig; - std::string sign = sig.generate("GET&%2F&AccessKeyId%3Dtestid%26Action%3DDescribeRegions" - "%26Format%3DXML%26RegionId%3Dregion1%26SignatureMethod%3DHMAC-SHA1" - "%26SignatureNonce%3DNwDAxvLU6tFE0DVb%26SignatureVersion%3D1.0" - "%26TimeStamp%3D2012-12-26T10%253A33%253A56Z%26Version%3D2013-01-10", - "testsecret&"); - REQUIRE("axE3FUHgDyfm9/+Iep0HpZXrRwE=" == sign); -} \ No newline at end of file diff --git a/core-tests/url.cc b/core-tests/url.cc deleted file mode 100644 index a35b190bf..000000000 --- a/core-tests/url.cc +++ /dev/null @@ -1,63 +0,0 @@ -/* -* Copyright 2009-2017 Alibaba Cloud All rights reserved. -* -* Licensed 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. -*/ - -#include -#include - -using namespace AlibabaCloud; - -TEST_CASE("testUrl") -{ - const std::string src = "abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1"; - Url url; - url.setScheme("abc"); - url.setUserName("username"); - url.setPassword("password"); - url.setHost("example.com"); - url.setPath("/path/data"); - url.setPort(123); - url.setQuery("key=value&key2=value2"); - url.setFragment("fragid1"); - REQUIRE(url.toString() == src); - - url.clear(); - url.fromString(src); - REQUIRE(url.scheme() == "abc"); - REQUIRE(url.userName() == "username"); - REQUIRE(url.password() == "password"); - REQUIRE(url.host() == "example.com"); - REQUIRE(url.path() == "/path/data"); - REQUIRE(url.port() == 123); - REQUIRE(url.query() == "key=value&key2=value2"); - REQUIRE(url.fragment() == "fragid1"); - - Url newurl = url; - REQUIRE(newurl == url); -} - -TEST_CASE("testUrl2") -{ - const std::string src = "http://oss.example.com"; - Url url(src); - REQUIRE(url.scheme() == "http"); - REQUIRE(url.userName() == ""); - REQUIRE(url.password() == ""); - REQUIRE(url.host() == "oss.example.com"); - REQUIRE(url.path() == "/"); - REQUIRE(url.port() == -1); - REQUIRE(url.query() == ""); - REQUIRE(url.fragment() == ""); -} \ No newline at end of file diff --git a/core/src/CurlHttpClient.cc b/core/src/CurlHttpClient.cc index 109523bbd..fe9ae1dc5 100644 --- a/core/src/CurlHttpClient.cc +++ b/core/src/CurlHttpClient.cc @@ -1,12 +1,12 @@ /* * Copyright 2009-2017 Alibaba Cloud All rights reserved. - * + * * Licensed 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.