Introduce selftest::locate_file
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 15 Dec 2016 01:47:48 +0000 (01:47 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 15 Dec 2016 01:47:48 +0000 (01:47 +0000)
commitecfc21ff34ddc6f8aa517251fb51494c68ff741f
tree308b5533291220862bf4989c1182e3793e2ad200
parente98ac2584c0237cbd81df626b8d446f21f54fa39
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
gcc/ChangeLog
gcc/Makefile.in
gcc/common.opt
gcc/selftest-run-tests.c
gcc/selftest.c
gcc/selftest.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/pr71591.c
gcc/testsuite/gcc.dg/pr78213.c
gcc/testsuite/selftests/example.txt [new file with mode: 0644]