[gnome-builder] tests: make TEST_DATA_DIR absolute



commit eadbcc1c909d52ba6b1a42f8bf6459d4a8d983fd
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Tue Nov 15 16:27:24 2016 +0800

    tests: make TEST_DATA_DIR absolute
    
    $(srcdir) is not always a relative path, so prepending the path of
    current directory doesn't always make a correct path.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774456

 tests/Makefile.am                  |    2 +-
 tests/test-ide-back-forward-list.c |    2 +-
 tests/test-ide-buffer-manager.c    |    2 +-
 tests/test-ide-buffer.c            |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e53af5e..789dc0c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,7 +4,7 @@ egg_cflags = \
        $(DEBUG_CFLAGS) \
        $(LIBIDE_CFLAGS) \
        -I$(top_srcdir)/contrib/egg \
-       -DTEST_DATA_DIR="\"$(srcdir)/data\"" \
+       -DTEST_DATA_DIR="\"$(abs_srcdir)/data\"" \
        $(NULL)
 
 egg_libs = \
diff --git a/tests/test-ide-back-forward-list.c b/tests/test-ide-back-forward-list.c
index 32084ac..e7c5d32 100644
--- a/tests/test-ide-back-forward-list.c
+++ b/tests/test-ide-back-forward-list.c
@@ -133,7 +133,7 @@ test_basic (GCancellable        *cancellable,
   GFile *project_file;
   GTask *task;
 
-  path = g_build_filename (g_get_current_dir (), TEST_DATA_DIR, "project1", "configure.ac", NULL);
+  path = g_build_filename (TEST_DATA_DIR, "project1", "configure.ac", NULL);
   project_file = g_file_new_for_path (path);
   task = g_task_new (NULL, cancellable, callback, user_data);
   ide_context_new_async (project_file, cancellable, test_basic_cb, task);
diff --git a/tests/test-ide-buffer-manager.c b/tests/test-ide-buffer-manager.c
index 3a6d275..72f07cc 100644
--- a/tests/test-ide-buffer-manager.c
+++ b/tests/test-ide-buffer-manager.c
@@ -133,7 +133,7 @@ test_buffer_manager_basic_cb1 (GObject      *object,
 
   project = ide_context_get_project (context);
 
-  path = g_build_filename (g_get_current_dir (), TEST_DATA_DIR, "project1", "configure.ac", NULL);
+  path = g_build_filename (TEST_DATA_DIR, "project1", "configure.ac", NULL);
   file = ide_project_get_file_for_path (project, path);
 
   ide_buffer_manager_load_file_async (buffer_manager,
diff --git a/tests/test-ide-buffer.c b/tests/test-ide-buffer.c
index 4946cd1..19e6a13 100644
--- a/tests/test-ide-buffer.c
+++ b/tests/test-ide-buffer.c
@@ -122,7 +122,7 @@ test_buffer_basic (GCancellable        *cancellable,
   IDE_ENTRY;
 
   task = g_task_new (NULL, cancellable, callback, user_data);
-  path = g_build_filename (g_get_current_dir (), TEST_DATA_DIR, "project1", "configure.ac", NULL);
+  path = g_build_filename (TEST_DATA_DIR, "project1", "configure.ac", NULL);
   project_file = g_file_new_for_path (path);
   ide_context_new_async (project_file, cancellable, test_buffer_basic_cb1, task);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]