aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-02-02 11:24:29 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-02-04 23:43:05 +0100
commit94df80b301c1fb40c3f5403844912ff6c22e4e2f (patch)
treeac054d09e30c7d0ac0ab62ce9a3a08598625ff3e
parent0db5d4e7d671ff8af9b5905d111851e608c842c2 (diff)
downloadayatana-indicator-display-94df80b301c1fb40c3f5403844912ff6c22e4e2f.tar.gz
ayatana-indicator-display-94df80b301c1fb40c3f5403844912ff6c22e4e2f.tar.bz2
ayatana-indicator-display-94df80b301c1fb40c3f5403844912ff6c22e4e2f.zip
Skip geoclue calls during the rotation lock test
-rw-r--r--src/rotation-lock.cpp7
-rw-r--r--tests/unit/CMakeLists.txt1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/rotation-lock.cpp b/src/rotation-lock.cpp
index 566025e..9864744 100644
--- a/src/rotation-lock.cpp
+++ b/src/rotation-lock.cpp
@@ -123,7 +123,12 @@ public:
#ifdef COLOR_TEMP_ENABLED
if (ayatana_common_utils_is_lomiri() == FALSE)
{
- gclue_simple_new_with_thresholds ("ayatana-indicator-display", GCLUE_ACCURACY_LEVEL_CITY, 0, 0, NULL, onGeoClueLoaded, this);
+ const gchar *sTest = g_getenv ("TEST_NAME");
+
+ if (sTest == NULL || !g_str_equal (sTest, "rotation-lock-test"))
+ {
+ gclue_simple_new_with_thresholds ("ayatana-indicator-display", GCLUE_ACCURACY_LEVEL_CITY, 0, 0, NULL, onGeoClueLoaded, this);
+ }
GVariant *pProfile = g_settings_get_value (this->m_settings, "color-temp-profile");
guint nProfile = g_variant_get_uint16 (pProfile);
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
index 930eb70..63061c8 100644
--- a/tests/unit/CMakeLists.txt
+++ b/tests/unit/CMakeLists.txt
@@ -57,6 +57,7 @@ function(add_test_by_name name)
add_test(${TEST_NAME} ${TEST_NAME})
add_dependencies(${TEST_NAME} gschemas-compiled)
set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT ${CTEST_ENVIRONMENT})
+ set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "TEST_NAME=${TEST_NAME}")
target_link_libraries(${TEST_NAME} ${SERVICE_LINK_LIBRARIES} ${TEST_LINK_LIBRARIES} ${THREAD_LINK_LIBRARIES})
endfunction()
add_test_by_name(adbd-client-test)