aboutsummaryrefslogtreecommitdiff
path: root/gcc/selftest.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-12-15 01:47:48 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-12-15 01:47:48 +0000
commitecfc21ff34ddc6f8aa517251fb51494c68ff741f (patch)
tree308b5533291220862bf4989c1182e3793e2ad200 /gcc/selftest.h
parente98ac2584c0237cbd81df626b8d446f21f54fa39 (diff)
downloadgcc-ecfc21ff34ddc6f8aa517251fb51494c68ff741f.zip
gcc-ecfc21ff34ddc6f8aa517251fb51494c68ff741f.tar.gz
gcc-ecfc21ff34ddc6f8aa517251fb51494c68ff741f.tar.bz2
Introduce selftest::locate_file
gcc/ChangeLog: * Makefile.in (SELFTEST_FLAGS): Add path argument to -fself-test. (s-selftest): Add dependency on the selftests data directory. * common.opt (fself-test): Rename to... (fself-test=): ...this, documenting the meaning of the argument. * selftest-run-tests.c (along): Likewise. * selftest-run-tests.c: Include "options.h". (selftest::run_tests): Initialize selftest::path_to_selftest_files from flag_self_test. * selftest.c (selftest::path_to_selftest_files): New global. (selftest::locate_file): New function. (selftest::test_locate_file): New function. (selftest_c_tests): Likewise. (selftest::selftest_c_tests): Call test_locate_file. * selftest.h (selftest::locate_file): New decl. (selftest::path_to_selftest_files): New decl. gcc/testsuite/ChangeLog: PR target/78213 * gcc.dg/cpp/pr71591.c: Add a fake value for the argument of -fself-test. * gcc.dg/pr78213.c: Disable this test. * selftests/example.txt: New file. From-SVN: r243681
Diffstat (limited to 'gcc/selftest.h')
-rw-r--r--gcc/selftest.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/selftest.h b/gcc/selftest.h
index dcce474..c390873 100644
--- a/gcc/selftest.h
+++ b/gcc/selftest.h
@@ -158,6 +158,16 @@ extern char *read_file (const location &loc, const char *path);
extern void forcibly_ggc_collect ();
+/* Convert a path relative to SRCDIR/gcc/testsuite/selftests
+ to a real path (either absolute, or relative to pwd).
+ The result should be freed by the caller. */
+
+extern char *locate_file (const char *path);
+
+/* The path of SRCDIR/testsuite/selftests. */
+
+extern const char *path_to_selftest_files;
+
/* Declarations for specific families of tests (by source file), in
alphabetical order. */
extern void bitmap_c_tests ();