[CCode (cname = "HAVE_TRACKER")]
public static bool HAVE_TRACKER;
+
+ [CCode (cname = "ABS_TOP_BUILDDIR")]
+ public static const string ABS_TOP_BUILDDIR;
+
+ [CCode (cname = "ABS_TOP_SRCDIR")]
+ public static const string ABS_TOP_SRCDIR;
+
+ [CCode (cname = "PKGLIBEXECDIR")]
+ public static const string PKGLIBEXECDIR;
}
$(AM_CPPFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir)/folks \
+ -DABS_TOP_SRCDIR=\"${abs_top_srcdir}\" \
+ -DABS_TOP_BUILDDIR=\"${abs_top_builddir}\" \
+ -DPKGLIBEXECDIR=\"${pkglibexecdir}\" \
$(NULL)
libfolks_test_la_LIBADD = \
--pkg gee-0.8 \
--pkg dbus-glib-1 \
--pkg folks \
+ --pkg build-conf \
--library folks-test \
-H folks-test.h \
-g \
assert (aggregator.is_quiescent == true);
}
}
+
+ /**
+ * Run a helper executable.
+ *
+ * @param argv Arguments for the executable. The first is the path of
+ * the executable itself, relative to ${builddir}/tests.
+ * @param capture_stdout If non-null, the executable's standard output is
+ * placed here. If null, the executable's standard output goes to the
+ * same place as the test's standard output.
+ */
+ public static void run_test_helper_sync (string[] argv,
+ out string capture_stdout = null) throws GLib.Error
+ {
+ string execdir;
+
+ if (Environment.get_variable ("FOLKS_TESTS_INSTALLED") != null)
+ {
+ execdir = BuildConf.PKGLIBEXECDIR + "/tests";
+ }
+ else
+ {
+ execdir = BuildConf.ABS_TOP_BUILDDIR + "/tests";
+ }
+
+ var argv_ = argv[0:argv.length];
+ argv_[0] = execdir + "/" + argv_[0];
+
+ int exit_status = -1;
+ Process.spawn_sync (null /* cwd */,
+ argv_,
+ null /* envp */,
+ 0 /* flags */,
+ null /* child setup */,
+ out capture_stdout,
+ null /* do not capture stderr */,
+ out exit_status);
+
+ Process.check_exit_status (exit_status);
+ }
}