Skip to content

Commit

Permalink
Merge branch 'develop' into rg/task/SDK-3755-add-icon-name-on-mega-no…
Browse files Browse the repository at this point in the history
…tification
  • Loading branch information
rgmez committed Mar 18, 2024
2 parents 3c3af31 + 60e1f13 commit 58ceda7
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 23 deletions.
12 changes: 8 additions & 4 deletions src/sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12005,10 +12005,14 @@ void Syncs::syncLoop()
lastRecurseMs = unsigned(std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::high_resolution_clock::now() - recurseStart).count());

LOG_verbose << "recursiveSync took ms: " << lastRecurseMs
<< (skippedForScanning ? " (" + std::to_string(skippedForScanning)+ " skipped due to ongoing scanning)" : "")
<< (mSyncFlags->noProgressCount ? " no progress count: " + std::to_string(mSyncFlags->noProgressCount) : "")
<< (earlyExit ? " (earlyExit)" : "");
const int noProgressCountLoggingFrequency = 500; // Log this every 500 counts
if (!skippedForScanning && !earlyExit && mSyncFlags->noProgressCount && (mSyncFlags->noProgressCount % noProgressCountLoggingFrequency == 0))
{
LOG_verbose << "recursiveSync took ms: " << lastRecurseMs
<< (skippedForScanning ? " (" + std::to_string(skippedForScanning)+ " skipped due to ongoing scanning)" : "")
<< (mSyncFlags->noProgressCount ? " no progress count: " + std::to_string(mSyncFlags->noProgressCount) : "")
<< (earlyExit ? " (earlyExit)" : "");
}


waiter->bumpds();
Expand Down
33 changes: 28 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# Common interface target for test tools
add_library(test_tools STATIC)
add_library(MEGA::test_tools ALIAS test_tools)

## Comon interface target for the unit and integration tests
target_sources(test_tools
PRIVATE
gtest_common.h
sdk_test_utils.h
stdfs.h

gtest_common.cpp
sdk_test_utils.cpp
)

target_link_libraries(test_tools PRIVATE MEGA::SDKlib)

target_include_directories(test_tools
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

# Common interface target for configurations and libraries for the SDK and MEGAchat tests.
add_library(test_common INTERFACE)
add_library(MEGA::test_common ALIAS test_common)

# Look for the libraries needed for both integration and unit tests.
# Look for the libraries needed for both unit tests and integration tests for the SDK and MEGAchat.
if(VCPKG_ROOT)
find_package(GTest CONFIG REQUIRED)
target_link_libraries(test_common INTERFACE GTest::gmock GTest::gtest)
Expand All @@ -12,12 +33,14 @@ else()
target_link_libraries(test_common INTERFACE PkgConfig::gmock PkgConfig::gtest)
endif()

if (WIN32)
if(WIN32)
target_compile_definitions(test_common
INTERFACE
NOMINMAX # TODO Fix locally
)
endif()

add_subdirectory(integration)
add_subdirectory(unit)
if(ENABLE_SDKLIB_TESTS) # This file is also loaded for MEGAchat tests.
add_subdirectory(integration)
add_subdirectory(unit)
endif()
18 changes: 6 additions & 12 deletions tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,22 @@ add_executable(test_integration)
target_sources(test_integration
PRIVATE
SdkTest_test.h
stdfs.h
test.h
sdk_test_utils.h
../gtest_common.h

main.cpp
SdkTest_test.cpp
Sync_test.cpp
sdk_test_utils.cpp
../gtest_common.cpp
)

target_include_directories(test_integration
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../
)

# Link with SDKlib
target_link_libraries(test_integration PRIVATE MEGA::SDKlib)

# Link with the common interface library for the tests.
target_link_libraries(test_integration PRIVATE test_common)
# Link with the common and tools interface libraries for the tests.
target_link_libraries(test_integration
PRIVATE
MEGA::test_tools
MEGA::test_common
)

# Adjust compilation flags for warnings and errors
target_platform_compile_options(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ target_sources_conditional(test_unit
target_link_libraries(test_unit PRIVATE MEGA::SDKlib)

# Link with the common interface library for the tests.
target_link_libraries(test_unit PRIVATE test_common)
target_link_libraries(test_unit PRIVATE MEGA::test_common)

# Adjust compilation flags for warnings and errors
target_platform_compile_options(
Expand Down
6 changes: 5 additions & 1 deletion tools/gfxworker/tests/integration/server_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "mega/gfx.h"
#include "mega/win32/gfx/worker/comms_client.h"
#include "mega/gfx/worker/client.h"
#include "mega/utils.h"

#include <gtest/gtest.h>

Expand All @@ -24,6 +25,7 @@ using mega::gfx::GfxClient;
using mega::gfx::IEndpoint;
using mega::GfxDimension;
using mega::LocalPath;
using mega::getCurrentPid;
using mega_test::ExecutableDir;
using namespace std::chrono_literals;

Expand All @@ -33,7 +35,9 @@ class ServerClientTest : public testing::Test
protected:
void SetUp() override
{
mPipeName = "MEGA_GFXWOKER_UNIT_TEST";
std::ostringstream oss;
oss << "MEGA_GFXWOKER_UNIT_TEST_" << getCurrentPid();
mPipeName = oss.str();
}

std::string mPipeName;
Expand Down

0 comments on commit 58ceda7

Please sign in to comment.