Creates the pathname to a data file that is required for a test.
This function is conceptually similar to
that the first argument has been replaced with a
The data file should either have been distributed with the module
containing the test (
G_TEST_DIST) or built as part of the build
system of that module (
In order for this function to work in srcdir != builddir situations, the G_TEST_SRCDIR and G_TEST_BUILDDIR environment variables need to have been defined. As of 2.38, this is done by the glib.mk included in GLib. Please ensure that your copy is up to date before using this function.
In case neither variable is set, this function will fall back to using the dirname portion of argv, possibly removing “.libs”. This allows for casual running of tests directly from the commandline in the srcdir == builddir case and should also support running of installed tests, assuming the data files have been installed in the same relative path as the test binary.
Available since: 2.38
This function is not directly available to language bindings.
The type of file (built vs. distributed)
The first segment of the pathname.
The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string.
NULL-terminated additional path segments.