-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix s3 crt checksum calc #3075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix s3 crt checksum calc #3075
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,52 @@ | ||
add_project(aws-cpp-sdk-s3-crt-integration-tests | ||
"Tests for the AWS S3 CRT C++ SDK" | ||
aws-cpp-sdk-s3-crt | ||
testing-resources | ||
aws-cpp-sdk-core) | ||
|
||
file(GLOB AWS_S3_CRT_SRC | ||
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" | ||
) | ||
|
||
file(GLOB AWS_S3_CRT_INTEGRATION_TESTS_SRC | ||
${AWS_S3_CRT_SRC} | ||
) | ||
|
||
add_definitions(-DRESOURCES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/resources") | ||
|
||
if(MSVC AND BUILD_SHARED_LIBS) | ||
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1) | ||
endif() | ||
|
||
enable_testing() | ||
|
||
if(PLATFORM_ANDROID AND BUILD_SHARED_LIBS) | ||
add_library(${PROJECT_NAME} ${AWS_S3_CRT_INTEGRATION_TESTS_SRC}) | ||
else() | ||
add_executable(${PROJECT_NAME} ${AWS_S3_CRT_INTEGRATION_TESTS_SRC}) | ||
endif() | ||
|
||
set_compiler_flags(${PROJECT_NAME}) | ||
set_compiler_warnings(${PROJECT_NAME}) | ||
|
||
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS}) | ||
|
||
if(MSVC AND BUILD_SHARED_LIBS) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:aws-cpp-sdk-s3-crt.dll /DELAYLOAD:aws-cpp-sdk-core.dll") | ||
target_link_libraries(${PROJECT_NAME} delayimp.lib) | ||
endif() | ||
set(TEST_LIST "aws-cpp-sdk-s3-crt-integration-tests:RunTests.cpp") | ||
|
||
# Only run memlimiter test if we are building with custom memory management | ||
if (CUSTOM_MEMORY_MANAGEMENT) | ||
list(APPEND TEST_LIST "aws-cpp-sdk-s3-crt-memory-checked-integration-tests:RunTestsWithMemTracer.cpp") | ||
endif () | ||
|
||
foreach(TEST IN LISTS TEST_LIST) | ||
string(REPLACE ":" ";" TEST_ITEMS "${TEST}") | ||
list(GET TEST_ITEMS 0 TEST_PROJECT_NAME) | ||
list(GET TEST_ITEMS 1 TEST_MAIN_FILE) | ||
|
||
add_project("${TEST_PROJECT_NAME}" | ||
"Tests for the AWS S3 CRT C++ SDK" | ||
aws-cpp-sdk-s3-crt | ||
testing-resources | ||
aws-cpp-sdk-core) | ||
|
||
file(GLOB AWS_S3_CRT_SRC | ||
"${TEST_MAIN_FILE}" | ||
"BucketAndObjectOperationTest.cpp" | ||
"S3ExpressTest.cpp" | ||
) | ||
|
||
file(GLOB AWS_S3_CRT_INTEGRATION_TESTS_SRC | ||
${AWS_S3_CRT_SRC} | ||
) | ||
|
||
add_definitions(-DRESOURCES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/resources") | ||
|
||
if(MSVC AND BUILD_SHARED_LIBS) | ||
add_definitions(-DGTEST_LINKED_AS_SHARED_LIBRARY=1) | ||
endif() | ||
|
||
enable_testing() | ||
|
||
if(PLATFORM_ANDROID AND BUILD_SHARED_LIBS) | ||
add_library(${PROJECT_NAME} ${AWS_S3_CRT_INTEGRATION_TESTS_SRC}) | ||
else() | ||
add_executable(${PROJECT_NAME} ${AWS_S3_CRT_INTEGRATION_TESTS_SRC}) | ||
endif() | ||
|
||
set_compiler_flags(${PROJECT_NAME}) | ||
set_compiler_warnings(${PROJECT_NAME}) | ||
|
||
target_link_libraries(${PROJECT_NAME} ${PROJECT_LIBS}) | ||
|
||
if(MSVC AND BUILD_SHARED_LIBS) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DELAYLOAD:aws-cpp-sdk-s3-crt.dll /DELAYLOAD:aws-cpp-sdk-core.dll") | ||
target_link_libraries(${PROJECT_NAME} delayimp.lib) | ||
endif() | ||
endforeach () |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0. | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
#include <aws/core/Aws.h> | ||
#include <aws/testing/platform/PlatformTesting.h> | ||
#include <aws/testing/TestingEnvironment.h> | ||
#include <aws/testing/MemoryTesting.h> | ||
|
||
int main(int argc, char** argv) { | ||
Aws::Testing::SetDefaultSigPipeHandler(); | ||
Aws::SDKOptions options; | ||
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; | ||
CRTMemTracerMemorySystem memorySystem{}; | ||
options.memoryManagementOptions.memoryManager = &memorySystem; | ||
Aws::Testing::InitPlatformTest(options); | ||
Aws::Testing::ParseArgs(argc, argv); | ||
|
||
Aws::InitAPI(options); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Begin() goes here and End() right after "ShutdownAPI" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is copy and pasted more or less from what we already do and how we use it in the crt test already |
||
::testing::InitGoogleTest(&argc, argv); | ||
int exitCode = RUN_ALL_TESTS(); | ||
|
||
Aws::ShutdownAPI(options); | ||
memorySystem.AssertNoLeaks(); | ||
Aws::Testing::ShutdownPlatformTest(options); | ||
return exitCode; | ||
} |
Uh oh!
There was an error while loading. Please reload this page.