fix travis config
* fix travis config * remove the useless files
This commit is contained in:
@@ -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
|
||||
@@ -93,4 +93,4 @@ add_subdirectory(ccs)
|
||||
add_subdirectory(saf)
|
||||
add_subdirectory(arms)
|
||||
add_subdirectory(lubancloud)
|
||||
add_subdirectory(alimt)
|
||||
add_subdirectory(alimt)
|
||||
|
||||
@@ -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)
|
||||
@@ -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 <catch.hpp>
|
||||
#include <alibabacloud/core/HttpRequest.h>
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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 <catch.hpp>
|
||||
@@ -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 <catch.hpp>
|
||||
#include <alibabacloud/core/HmacSha1Signer.h>
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -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 <catch.hpp>
|
||||
#include <alibabacloud/core/Url.h>
|
||||
|
||||
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() == "");
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user