Skip to content

Commit 4b3b522

Browse files
committed
Added core-tests to build
Introduced generated exported visibility header. Added all core-tests to the build for ctest. All tests build, not all pass, fixes coming up next.
1 parent 80f7826 commit 4b3b522

File tree

14 files changed

+109
-50
lines changed

14 files changed

+109
-50
lines changed

src/aws-cpp-sdk-core-tests/CMakeLists.txt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
11
if (NOT LEGACY_BUILD)
2-
add_library(aws-sdk-cpp-test-resources)
3-
add_library(aws-sdk-cpp::test-resources ALIAS aws-sdk-cpp-test-resources)
4-
target_link_libraries(
5-
aws-sdk-cpp-test-resources
6-
GTest::GTest
7-
aws-sdk-cpp::core
8-
aws-sdk-cpp::test-resources
9-
aws-crt-cpp
10-
)
11-
add_subdirectory(testing-resources)
2+
add_executable(aws-sdk-cpp-core-test)
123

13-
add_executable(aws_core_test)
144
target_link_libraries(
15-
aws_core_test
5+
aws-sdk-cpp-core-test
166
GTest::GTest
177
aws-sdk-cpp::core
18-
aws-sdk-cpp::test-resources
198
aws-crt-cpp
209
)
2110
target_sources(
22-
aws_core_test
11+
aws-sdk-cpp-core-test
2312
PRIVATE
2413
${CMAKE_CURRENT_SOURCE_DIR}/RunTests.cpp
2514
${CMAKE_CURRENT_SOURCE_DIR}/VersionTests.cpp
2615
)
27-
gtest_discover_tests(aws_core_test)
2816

29-
message(WARNING "Building core test with new cmake scripts not yet implemented")
17+
add_subdirectory(aws)
18+
add_subdirectory(http)
19+
add_subdirectory(monitoring)
20+
add_subdirectory(testing-resources)
21+
add_subdirectory(utils)
22+
23+
gtest_discover_tests(aws-sdk-cpp-core-test)
3024
else ()
3125
add_project(aws-cpp-sdk-core-tests
3226
"Tests for the AWS Core C++ Library"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_SOURCE_DIR}/RegionTest.cpp
5+
)
6+
add_subdirectory(auth)
7+
add_subdirectory(client)
8+
add_subdirectory(config)
9+
add_subdirectory(net)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_SOURCE_DIR}/AWSAuthSignerTest.cpp
5+
${CMAKE_CURRENT_SOURCE_DIR}/AWSCredentialsProviderTest.cpp
6+
${CMAKE_CURRENT_SOURCE_DIR}/AWSHttpResourceClientTest.cpp
7+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_SOURCE_DIR}/AdaptiveRetryStrategyTest.cpp
5+
${CMAKE_CURRENT_SOURCE_DIR}/AWSClientTest.cpp
6+
${CMAKE_CURRENT_SOURCE_DIR}/AWSErrorMashallerTest.cpp
7+
${CMAKE_CURRENT_SOURCE_DIR}/HttpSchemeMapperTest.cpp
8+
${CMAKE_CURRENT_SOURCE_DIR}/RetryStrategyTest.cpp
9+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_SOURCE_DIR}/AWSProfileConfigLoaderTest.cpp
5+
${CMAKE_CURRENT_SOURCE_DIR}/ClientConfigurationDefaultsTest.cpp
6+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_SOURCE_DIR}/UDPTest.cpp
5+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_SOURCE_DIR}/HttpClientTest.cpp
5+
${CMAKE_CURRENT_SOURCE_DIR}/HttpTypesMapperTest.cpp
6+
${CMAKE_CURRENT_SOURCE_DIR}/SignalHandlerTest.cpp
7+
${CMAKE_CURRENT_SOURCE_DIR}/URITest.cpp
8+
)
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
1-
add_executable(
2-
aws-core-monitoring
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
34
${CMAKE_CURRENT_LIST_DIR}/MonitoringEndToEndTest.cpp
45
${CMAKE_CURRENT_LIST_DIR}/MonitoringTest.cpp
5-
)
6-
target_include_directories(
7-
aws-core-monitoring
8-
PRIVATE GTest::GTest
9-
)
10-
target_link_libraries(
11-
aws-core-monitoring
12-
PRIVATE GTest::GTest
13-
PRIVATE aws-sdk-cpp::core
146
)

src/aws-cpp-sdk-core-tests/testing-resources/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ add_project(testing-resources
99
"Testing utility library for the AWS C++ SDK"
1010
aws-cpp-sdk-core)
1111

12-
include(GenerateExportHeader)
13-
1412
file(GLOB AWS_TESTING_HEADERS "include/aws/testing/*.h")
1513
file(GLOB AWS_TESTING_EXTERNAL_HEADERS "include/aws/external/*.h")
1614
file(GLOB AWS_TESTING_AUTH_MOCKS_HEADERS "include/aws/testing/mocks/aws/auth/*.h")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
target_include_directories(
2-
aws-sdk-cpp-test-resources
2+
aws-sdk-cpp-core-test
33
BEFORE
44
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
55
)

src/aws-cpp-sdk-core-tests/testing-resources/source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
target_sources(
2-
aws-sdk-cpp-test-resources
2+
aws-sdk-cpp-core-test
33
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/MemoryTesting.cpp
44
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/TestingEnvironment.cpp
55
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/platform/linux-shared/PlatformTesting.cpp
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
target_sources(
2+
aws-sdk-cpp-core-test
3+
PRIVATE
4+
${CMAKE_CURRENT_LIST_DIR}/ARNTest.cpp
5+
${CMAKE_CURRENT_LIST_DIR}/CacheTest.cpp
6+
${CMAKE_CURRENT_LIST_DIR}/CompilerMacrosTest.cpp
7+
${CMAKE_CURRENT_LIST_DIR}/DateTimeTest.cpp
8+
${CMAKE_CURRENT_LIST_DIR}/DNSTest.cpp
9+
${CMAKE_CURRENT_LIST_DIR}/DocumentTest.cpp
10+
${CMAKE_CURRENT_LIST_DIR}/EnumOverflowTest.cpp
11+
${CMAKE_CURRENT_LIST_DIR}/FileSystemUtilsTest.cpp
12+
${CMAKE_CURRENT_LIST_DIR}/GetTheLightsTest.cpp
13+
${CMAKE_CURRENT_LIST_DIR}/HashingUtilsTest.cpp
14+
${CMAKE_CURRENT_LIST_DIR}/OSVersionInfoTest.cpp
15+
${CMAKE_CURRENT_LIST_DIR}/OutcomeTest.cpp
16+
${CMAKE_CURRENT_LIST_DIR}/StringUtilsTest.cpp
17+
${CMAKE_CURRENT_LIST_DIR}/UUIDTest.cpp
18+
)

src/aws-cpp-sdk-core/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ if (NOT LEGACY_BUILD)
44

55
target_include_directories(
66
aws-sdk-cpp-core
7+
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
78
PUBLIC ${aws-crt-cpp_INCLUDE_DIRS}
89
PUBLIC ${CJSON_INCLUDE_DIRS}
9-
PUBLIC ${tinyxml2_INCLUDE_DIRS}
1010
)
1111
message(STATUS "CRT: ${aws-crt-cpp_LIBRARY_DIRS}")
1212
target_link_directories(
1313
aws-sdk-cpp-core
1414
PUBLIC ${aws-crt-cpp_LIBRARY_DIRS}
1515
PUBLIC ${CJSON_LIBRARY_DIRS}
16-
PUBLIC ${tinyxml2_LIBRARY_DIRS}
1716
)
1817
target_link_libraries(
1918
aws-sdk-cpp-core
@@ -22,6 +21,14 @@ if (NOT LEGACY_BUILD)
2221
tinyxml2::tinyxml2
2322
CURL::libcurl
2423
)
24+
25+
include(GenerateExportHeader)
26+
generate_export_header(
27+
aws-sdk-cpp-core
28+
EXPORT_MACRO_NAME AWS_CORE_API # to be backward compatible during LEGACY_BUILD exist until 1.11
29+
)
30+
31+
2532
add_subdirectory(include)
2633
add_subdirectory(source)
2734
else ()

src/aws-cpp-sdk-core/include/aws/core/Core_EXPORTS.h

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@
55

66
#pragma once
77

8-
#include <aws/core/SDKConfig.h>
8+
#ifdef NON_LEGACY_BUILD
9+
#include "aws-sdk-cpp-core_export.h"
10+
#else
911

10-
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
11-
#ifdef _MSC_VER
12-
#pragma warning(disable : 4251)
13-
#endif // _MSC_VER
14-
15-
#ifdef USE_IMPORT_EXPORT
16-
#ifdef AWS_CORE_EXPORTS
17-
#define AWS_CORE_API __declspec(dllexport)
18-
#else // AWS_CORE_EXPORTS
19-
#define AWS_CORE_API __declspec(dllimport)
20-
#endif // AWS_CORE_EXPORTS
21-
#else // USE_IMPORT_EXPORT
12+
#include <aws/core/SDKConfig.h>
13+
14+
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
15+
#ifdef _MSC_VER
16+
#pragma warning(disable : 4251)
17+
#endif // _MSC_VER
18+
19+
#ifdef USE_IMPORT_EXPORT
20+
#ifdef AWS_CORE_EXPORTS
21+
#define AWS_CORE_API __declspec(dllexport)
22+
#else // AWS_CORE_EXPORTS
23+
#define AWS_CORE_API __declspec(dllimport)
24+
#endif // AWS_CORE_EXPORTS
25+
#else // USE_IMPORT_EXPORT
26+
#define AWS_CORE_API
27+
#endif // USE_IMPORT_EXPORT
28+
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
2229
#define AWS_CORE_API
23-
#endif // USE_IMPORT_EXPORT
24-
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
25-
#define AWS_CORE_API
26-
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
30+
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
31+
32+
#endif
2733

2834
#ifdef _MSC_VER
2935
#define AWS_SUPPRESS_WARNING_PUSH(W) \

0 commit comments

Comments
 (0)