Use g_test_get_dir in test to locate files

This makes the tests work both installed and for make check.
This commit is contained in:
Matthias Clasen 2013-05-29 21:37:05 -04:00
parent 3d225fb059
commit c8a392612b
3 changed files with 3 additions and 14 deletions

View File

@ -861,13 +861,9 @@ main (int argc, char **argv)
if (arg_base_dir)
basedir = arg_base_dir;
else if (g_getenv ("srcdir"))
basedir = g_getenv ("srcdir");
else
basedir = ".";
basedir = g_test_get_dir (G_TEST_DIST);
dir = g_file_new_for_path (basedir);
add_tests_for_files_in_directory (dir);
g_object_unref (dir);

View File

@ -393,13 +393,8 @@ main (int argc, char **argv)
const char *basedir;
GFile *dir;
if (g_getenv ("srcdir"))
basedir = g_getenv ("srcdir");
else
basedir = ".";
basedir = g_test_get_dir (G_TEST_DIST);
dir = g_file_new_for_path (basedir);
add_tests_for_files_in_directory (dir);
g_object_unref (dir);

View File

@ -584,10 +584,8 @@ main (int argc, char **argv)
if (arg_base_dir)
basedir = arg_base_dir;
else if (g_getenv ("srcdir"))
basedir = g_getenv ("srcdir");
else
basedir = ".";
basedir = g_test_get_dir (G_TEST_DIST);
if (argc < 2)
{