test: serialize session bus tests and fix the thumbnailer race

pull/18/head
reionwong 2 weeks ago
parent 7906520ebb
commit 6e71c2fa45

@ -3,4 +3,5 @@ include(GoogleTest)
add_executable(accounts-client-tests accounts_test.cpp)
target_link_libraries(accounts-client-tests PRIVATE Cutefish::AccountsClient GTest::gtest_main)
gtest_discover_tests(accounts-client-tests)
# Each case owns org.freedesktop.Accounts on the shared session bus.
gtest_discover_tests(accounts-client-tests PROPERTIES RESOURCE_LOCK accounts-session-bus)

@ -3,4 +3,5 @@ include(GoogleTest)
add_executable(powerprofiles-client-tests powerprofiles_test.cpp)
target_link_libraries(powerprofiles-client-tests PRIVATE Cutefish::PowerProfilesClient GTest::gtest_main)
gtest_discover_tests(powerprofiles-client-tests)
# Each case owns org.freedesktop.UPower.PowerProfiles on the shared session bus.
gtest_discover_tests(powerprofiles-client-tests PROPERTIES RESOURCE_LOCK powerprofiles-session-bus)

@ -3,4 +3,5 @@ include(GoogleTest)
add_executable(timedate-client-tests timedate_test.cpp)
target_link_libraries(timedate-client-tests PRIVATE Cutefish::TimeDateClient GTest::gtest_main)
gtest_discover_tests(timedate-client-tests)
# Each case owns org.freedesktop.timedate1 on the shared session bus.
gtest_discover_tests(timedate-client-tests PROPERTIES RESOURCE_LOCK timedate-session-bus)

@ -3,4 +3,5 @@ include(GoogleTest)
add_executable(upower-client-tests upower_test.cpp)
target_link_libraries(upower-client-tests PRIVATE Cutefish::UPowerClient GTest::gtest_main)
gtest_discover_tests(upower-client-tests)
# Each case owns org.freedesktop.UPower on the shared session bus.
gtest_discover_tests(upower-client-tests PROPERTIES RESOURCE_LOCK upower-session-bus)

@ -210,6 +210,9 @@ TEST_F(ThumbnailersTest, SkipsMissingPrograms)
TEST_F(ThumbnailersTest, PicksUpNewThumbnailers)
{
EXPECT_FALSE(ThumbnailCache::self()->canThumbnail("text/markdown"));
// Directory times tick every few milliseconds; a file added in the same
// tick as the scan would leave the directory's time unchanged.
std::this_thread::sleep_for(20ms);
installThumbnailer("markdown.thumbnailer", "Exec=true %i %o\nMimeType=text/markdown;\n");
bool found = false;

Loading…
Cancel
Save