[gnome-builder] tests: avoid test-ide-builder with read-only srcdir



commit f44cb50cc6bafa0ada8946afbf720f6c76fd6395
Author: Christian Hergert <chergert redhat com>
Date:   Wed Dec 21 17:02:24 2016 -0800

    tests: avoid test-ide-builder with read-only srcdir
    
    We cannot bootstrap the project if the srcdir is read-only (such as with
    distcheck), so we will just skip the test.

 tests/test-ide-builder.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tests/test-ide-builder.c b/tests/test-ide-builder.c
index 8b994b7..2ff9cce 100644
--- a/tests/test-ide-builder.c
+++ b/tests/test-ide-builder.c
@@ -17,6 +17,7 @@
  */
 
 #include <glib.h>
+#include <glib/gstdio.h>
 #include <ide.h>
 
 #include "application/ide-application-tests.h"
@@ -184,6 +185,17 @@ test_build_system_autotools (GCancellable        *cancellable,
   path = g_build_filename (srcdir, "data", "project1", "configure.ac", NULL);
   project_file = g_file_new_for_path (path);
 
+  /*
+   * If the project file is read-only, that means we are in distcheck with an
+   * out of tree build. We can't do this because the srcdir will be read-only.
+   */
+  if (g_access (path, W_OK) != 0)
+    {
+      g_test_skip ("Cannot run test with read-only srcdir");
+      g_task_return_boolean (task, TRUE);
+      return;
+    }
+
   ide_context_new_async (project_file,
                          cancellable,
                          context_loaded_cb,


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