test_file_path, test_file_path_free

(Locate test files for a TAP test)

SYNOPSIS

#include <tap/basic.h>

char *test_file_path(const char *file);

void test_file_path_free(char *path);

DESCRIPTION

Given a partial file name, test_file_path() looks for that file under the directories named by the C_TAP_BUILD and then C_TAP_SOURCE environment variables and returns the full path to the first matching file. If the file is not found under either directory, it returns NULL. This can be used to locate test data without regard to whether it's in the source tree or generated as part of the build tree.

test_file_path_free() frees the path returned by test_file_path().

RETURN VALUE

test_file_path() returns the full path to the first matching file as a string or NULL if the file was not found.

AUTHOR

Russ Allbery <eagle@eyrie.org>

COPYRIGHT AND LICENSE

Copyright 2010, 2013, 2016 Russ Allbery <eagle@eyrie.org>

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

SPDX-License-Identifier: FSFAP

SEE ALSO

runtests(1)

The current version of the C TAP Harness library is available from its web page at <https://www.eyrie.org/~eagle/software/c-tap-harness/>.

Last spun 2022-12-12 from POD modified 2018-01-16