aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/warn-notification.vala2
-rw-r--r--tests/integration/CMakeLists.txt13
-rw-r--r--tests/integration/main.cpp17
3 files changed, 18 insertions, 14 deletions
diff --git a/src/warn-notification.vala b/src/warn-notification.vala
index f5c8b0b..12e34e4 100644
--- a/src/warn-notification.vala
+++ b/src/warn-notification.vala
@@ -29,7 +29,7 @@ public class IndicatorSound.WarnNotification: Notification
protected override Notify.Notification create_notification () {
var n = new Notify.Notification (
_("Volume"),
- _("High volume can damage your hearing."),
+ _("Allow volume above safe level?\nHigh volume can damage your hearing."),
"audio-volume-high");
n.set_hint ("x-canonical-non-shaped-icon", "true");
n.set_hint ("x-canonical-snap-decisions", "true");
diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt
index 74b9c23..e803a87 100644
--- a/tests/integration/CMakeLists.txt
+++ b/tests/integration/CMakeLists.txt
@@ -87,19 +87,6 @@ target_link_libraries(
gmenuharness-shared
)
-####
-## When building under jenkins, pulseuadio fails to start as there is no
-## /run/user tree, HOME directory is missing, and similar issues. So here
-## we check that we are the jenkins user, and avoid the integration tests,
-## until such time in future when we can run these tests in some different
-## manner to avoid needing to run pulseaudio in this way.
-####
-execute_process(
- COMMAND whoami
- OUTPUT_VARIABLE TESTS_USER
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-
add_test(
integration-tests
integration-tests
diff --git a/tests/integration/main.cpp b/tests/integration/main.cpp
index a29b3b6..f42c90a 100644
--- a/tests/integration/main.cpp
+++ b/tests/integration/main.cpp
@@ -20,6 +20,7 @@
//#include <config.h>
#include <QCoreApplication>
+#include <QTemporaryDir>
#include <QTimer>
#include <gtest/gtest.h>
@@ -44,6 +45,22 @@ int main(int argc, char **argv)
qputenv("LANG", "C.UTF-8");
unsetenv("LC_ALL");
+ /*
+ * A couple of things rely on having a HOME directory:
+ * - The indicator itself relies on having a writable gsettings/dconf
+ * database, and the test relies on the functionality it provides.
+ * - The test starts Pulseaudio, which requires both a runtime and a
+ * state directory, both of which has a failback to the HOME.
+ * Provide a temporary HOME for the test and its child, which both prevents
+ * polluting the building user's HOME and allow the test to run where
+ * HOME=/nonexistent (i.e. autobuilder).
+ */
+ QTemporaryDir tmpHome;
+ if (!tmpHome.isValid())
+ qFatal("Cannot create a temporary HOME for the test.");
+
+ setenv("HOME", tmpHome.path().toLocal8Bit().constData(), true);
+
QCoreApplication application(argc, argv);
DBusMock::registerMetaTypes();
DBusTypes::registerMetaTypes();