Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ if (ENABLE_COVERAGE)
)

target_link_libraries(
GameAnalytics
PRIVATE
--coverage
GameAnalytics PRIVATE -fprofile-arcs -ftest-coverage
)

set(covname cov)
Expand All @@ -289,13 +287,22 @@ if (ENABLE_COVERAGE)
COMMAND GameAnalyticsUnitTests

# Capturing lcov counters and generating report
COMMAND ${LCOV_PATH} --directory . --capture --output-file ${covname}.info

COMMAND echo "Processing code coverage counters and generating report."

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."

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."
)

if (GENHTML_PATH)
Expand Down
1 change: 1 addition & 0 deletions source/dependencies/crossguid/guid.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ THE SOFTWARE.
#include <string_view>
#include <utility>
#include <iomanip>
#include <cinttypes>

#define BEGIN_XG_NAMESPACE namespace xg {
#define END_XG_NAMESPACE }
Expand Down
7 changes: 1 addition & 6 deletions source/gameanalytics/GameAnalytics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions source/gameanalytics/Platform/GAMacOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ int64_t gameanalytics::GAPlatformMacOS::getBootTime() const
struct timeval currentTime = {};

gettimeofday(&currentTime, NULL);

return currentTime.tv_sec - startTime.tv_sec;

int64_t remainingMs = static_cast<double>(currentTime.tv_usec - startTime.tv_usec) * 1e-3;
return (currentTime.tv_sec - startTime.tv_sec) * 1000 + remainingMs;
}

#endif
2 changes: 1 addition & 1 deletion source/gameanalytics/Platform/GAWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::chrono::seconds>(timeInNs).count();
return std::chrono::duration_cast<std::chrono::milliseconds>(timeInNs).count();
}

return 0ll;
Expand Down