< test_cleanup_register | Russ Allbery > Software > C TAP Harness | test_tmpdir > |
(Locate test files for a TAP test)
#include <tap/basic.h>
char *test_file_path(const char *file);
void test_file_path_free(char *path);
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().
test_file_path() returns the full path to the first matching file as a string or NULL if the file was not found.
Russ Allbery <eagle@eyrie.org>
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
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/>.
< test_cleanup_register | Russ Allbery > Software > C TAP Harness | test_tmpdir > |