mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-04-25 02:40:53 +02:00
selftest: Globally set configuration path
Set $UPOWER_CONF_FILE_NAME before calling the tests, so that other tests can also initialize the daemon.
This commit is contained in:
parent
0716e21a33
commit
8a9d9a47bd
1 changed files with 6 additions and 6 deletions
|
|
@ -64,12 +64,6 @@ up_test_daemon_func (void)
|
|||
{
|
||||
UpDaemon *daemon;
|
||||
|
||||
/* make check, vs. make distcheck */
|
||||
if (g_file_test ("../etc/UPower.conf", G_FILE_TEST_EXISTS))
|
||||
g_setenv ("UPOWER_CONF_FILE_NAME", "../etc/UPower.conf", TRUE);
|
||||
else
|
||||
g_setenv ("UPOWER_CONF_FILE_NAME", "../../etc/UPower.conf", TRUE);
|
||||
|
||||
daemon = up_daemon_new ();
|
||||
g_assert (daemon != NULL);
|
||||
|
||||
|
|
@ -285,6 +279,12 @@ main (int argc, char **argv)
|
|||
g_type_init ();
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* make check, vs. make distcheck */
|
||||
if (g_file_test ("../etc/UPower.conf", G_FILE_TEST_EXISTS))
|
||||
g_setenv ("UPOWER_CONF_FILE_NAME", "../etc/UPower.conf", TRUE);
|
||||
else
|
||||
g_setenv ("UPOWER_CONF_FILE_NAME", "../../etc/UPower.conf", TRUE);
|
||||
|
||||
/* tests go here */
|
||||
g_test_add_func ("/power/backend", up_test_backend_func);
|
||||
g_test_add_func ("/power/device", up_test_device_func);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue