[ Version ( since = "2.38" ) ]
public string build_filename (FileType file_type, string[] path_segments)

Creates the pathname to a data file that is required for a test.

This function is conceptually similar to build_filename except that the first argument has been replaced with a FileType argument.

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 (g_test_built).

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 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[0], 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.



the type of file (built vs. distributed)


the first segment of the pathname


null-terminated additional path segments


the path of the file, to be freed using g_free

Namespace: GLib.Test
Package: glib-2.0