From c22df9cb789ca7b9f9baf0d37f5e48eaeeb195a2 Mon Sep 17 00:00:00 2001 From: Dorin Date: Fri, 14 Feb 2025 13:22:45 +0200 Subject: [PATCH 01/11] boot time in ms --- source/gameanalytics/Platform/GAMacOS.cpp | 5 +++-- source/gameanalytics/Platform/GAWin32.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/gameanalytics/Platform/GAMacOS.cpp b/source/gameanalytics/Platform/GAMacOS.cpp index 31509e2e..1fba913b 100644 --- a/source/gameanalytics/Platform/GAMacOS.cpp +++ b/source/gameanalytics/Platform/GAMacOS.cpp @@ -259,8 +259,9 @@ int64_t gameanalytics::GAPlatformMacOS::getBootTime() const struct timeval currentTime = {}; gettimeofday(¤tTime, NULL); - - return currentTime.tv_sec - startTime.tv_sec; + + int64_t remainingMs = static_cast(currentTime.tv_usec - startTime.tv_usec) * 1e-3; + return (currentTime.tv_sec - startTime.tv_sec) * 1000 + remainingMs; } #endif diff --git a/source/gameanalytics/Platform/GAWin32.cpp b/source/gameanalytics/Platform/GAWin32.cpp index f0f43ef1..f63d8320 100644 --- a/source/gameanalytics/Platform/GAWin32.cpp +++ b/source/gameanalytics/Platform/GAWin32.cpp @@ -332,7 +332,7 @@ int64_t GAPlatformWin32::getBootTime() const // filetime is expressed in 100s of nanoseconds std::chrono::nanoseconds timeInNs = std::chrono::nanoseconds(value * 100); - return std::chrono::duration_cast(timeInNs).count(); + return std::chrono::duration_cast(timeInNs).count(); } return 0ll; From 83e4191da176d48d93705ab4f82026d34a1ba5e6 Mon Sep 17 00:00:00 2001 From: Dorin Date: Fri, 14 Feb 2025 13:23:30 +0200 Subject: [PATCH 02/11] bugfix: design event will now receive values --- source/gameanalytics/GameAnalytics.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source/gameanalytics/GameAnalytics.cpp b/source/gameanalytics/GameAnalytics.cpp index 06f06d69..3c33a4ee 100644 --- a/source/gameanalytics/GameAnalytics.cpp +++ b/source/gameanalytics/GameAnalytics.cpp @@ -517,7 +517,7 @@ namespace gameanalytics try { json fieldsJson = utilities::parseFields(fields); - events::GAEvents::addDesignEvent(eventId, value, false, fieldsJson, mergeFields); + events::GAEvents::addDesignEvent(eventId, value, true, fieldsJson, mergeFields); } catch(json::exception const& e) { @@ -739,11 +739,6 @@ namespace gameanalytics }); } - std::string GameAnalytics::getRemoteConfigsValueAsString(std::string const& key) - { - return getRemoteConfigsValueAsString(key, ""); - } - std::string GameAnalytics::getRemoteConfigsValueAsString(std::string const& key, std::string const& defaultValue) { return state::GAState::getRemoteConfigsStringValue(key, defaultValue); From dd62f0f9cabf9633dcac5615d32ee9b3fc33fd81 Mon Sep 17 00:00:00 2001 From: Dorin Date: Fri, 14 Feb 2025 13:29:25 +0200 Subject: [PATCH 03/11] linux will now find uint64_t --- source/dependencies/crossguid/guid.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dependencies/crossguid/guid.h b/source/dependencies/crossguid/guid.h index 7304aeef..ed5c74ef 100644 --- a/source/dependencies/crossguid/guid.h +++ b/source/dependencies/crossguid/guid.h @@ -36,6 +36,7 @@ THE SOFTWARE. #include #include #include +#include #define BEGIN_XG_NAMESPACE namespace xg { #define END_XG_NAMESPACE } From 3c6f0bf7260bc536aac773ca24f113ac0078feb3 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 14:50:28 +0200 Subject: [PATCH 04/11] Update CMakeLists.txt --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5d0e0f5..f56fc75f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,9 +273,7 @@ if (ENABLE_COVERAGE) ) target_link_libraries( - GameAnalytics - PRIVATE - --coverage + GameAnalytics PRIVATE -fprofile-arcs -ftest-coverage ) set(covname cov) @@ -289,7 +287,8 @@ if (ENABLE_COVERAGE) COMMAND GameAnalyticsUnitTests # Capturing lcov counters and generating report - COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info + COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage + COMMAND ${LCOV_PATH} --remove ${covname}.info '${CMAKE_SOURCE_DIR}/source/dependencies/*' '${CMAKE_SOURCE_DIR}/test/*' From 381339642d6755a8f9bfff8e934b9899b7e37f3e Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:02:56 +0200 Subject: [PATCH 05/11] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f56fc75f..b9919b1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,7 +287,7 @@ if (ENABLE_COVERAGE) COMMAND GameAnalyticsUnitTests # Capturing lcov counters and generating report - COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage + COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --exclude '/Applications/Xcode-*/' --rc geninfo_unexecuted_blocks=1 COMMAND ${LCOV_PATH} --remove ${covname}.info '${CMAKE_SOURCE_DIR}/source/dependencies/*' From c048fc8866ac4a90ce0e960d8a4cc07872cbffb5 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:10:13 +0200 Subject: [PATCH 06/11] Update CMakeLists.txt --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9919b1d..8c2eda76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,14 +287,21 @@ if (ENABLE_COVERAGE) COMMAND GameAnalyticsUnitTests # Capturing lcov counters and generating report - COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --exclude '/Applications/Xcode-*/' --rc geninfo_unexecuted_blocks=1 + COMMAND echo "Processing code coverage counters and generating report." + + COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --exclude '/Applications/Xcode*/' --rc geninfo_unexecuted_blocks=1 + + COMMAND echo "Removing unwanted files from coverage report." + COMMAND ${LCOV_PATH} --remove ${covname}.info '${CMAKE_SOURCE_DIR}/source/dependencies/*' '${CMAKE_SOURCE_DIR}/test/*' '/usr/*' '/Applications/Xcode.app/*' --output-file ${covname}.info.cleaned + + COMMAND echo "Finished processing code coverage counters and generating report." ) if (GENHTML_PATH) From 299ecf95fe8a1ed0724ebc8d2033dae2d31dacba Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:13:35 +0200 Subject: [PATCH 07/11] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c2eda76..30b0cd54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,7 +290,7 @@ if (ENABLE_COVERAGE) COMMAND echo "Processing code coverage counters and generating report." - COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --exclude '/Applications/Xcode*/' --rc geninfo_unexecuted_blocks=1 + COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --exclude '/Applications/Xcode*/' --rc geninfo_unexecuted_blocks=1 --rc no_exception_branch=1 COMMAND echo "Removing unwanted files from coverage report." From 0c3296d23bf9ea980e1b2eeab9801953d436ebee Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:16:17 +0200 Subject: [PATCH 08/11] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30b0cd54..25559721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,7 +290,7 @@ if (ENABLE_COVERAGE) COMMAND echo "Processing code coverage counters and generating report." - COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --exclude '/Applications/Xcode*/' --rc geninfo_unexecuted_blocks=1 --rc no_exception_branch=1 + COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info --branch-coverage --rc geninfo_unexecuted_blocks=1 --rc no_exception_branch=1 COMMAND echo "Removing unwanted files from coverage report." From e9257976cc325cf00369aaa5ed22e29a0a235040 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:19:07 +0200 Subject: [PATCH 09/11] Update CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25559721..70c3b23e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,7 +296,6 @@ if (ENABLE_COVERAGE) COMMAND ${LCOV_PATH} --remove ${covname}.info '${CMAKE_SOURCE_DIR}/source/dependencies/*' - '${CMAKE_SOURCE_DIR}/test/*' '/usr/*' '/Applications/Xcode.app/*' --output-file ${covname}.info.cleaned From 4c0901b4e6ac3c5ee01c1891a51a204b1d41d545 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:22:42 +0200 Subject: [PATCH 10/11] Update CMakeLists.txt --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70c3b23e..3627bdd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,9 +296,11 @@ if (ENABLE_COVERAGE) COMMAND ${LCOV_PATH} --remove ${covname}.info '${CMAKE_SOURCE_DIR}/source/dependencies/*' + '${CMAKE_SOURCE_DIR}/test/*' '/usr/*' '/Applications/Xcode.app/*' --output-file ${covname}.info.cleaned + --ignore-errors unused COMMAND echo "Finished processing code coverage counters and generating report." ) From b897cd043048d98c764c4084e696e9e7ce62d16e Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Feb 2025 15:28:02 +0200 Subject: [PATCH 11/11] Update coverage.yml --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9215da07..3f848dc9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -34,7 +34,7 @@ jobs: run: cmake --build . --target cov_data - name: Report code coverage - uses: zgosalvez/github-actions-report-lcov@v3 + uses: zgosalvez/github-actions-report-lcov@v4 with: coverage-files: build/cov.info.cleaned minimum-coverage: 30