aboutsummaryrefslogtreecommitdiff
path: root/gcc/selftest-run-tests.c
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-run-tests.c
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-run-tests.c')
-rw-r--r--gcc/selftest-run-tests.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/selftest-run-tests.c b/gcc/selftest-run-tests.c
index a4cdb55..c1cd97e 100644
--- a/gcc/selftest-run-tests.c
+++ b/gcc/selftest-run-tests.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "target.h"
#include "langhooks.h"
+#include "options.h"
/* This function needed to be split out from selftest.c as it references
tests from the whole source tree, and so is within
@@ -38,6 +39,13 @@ along with GCC; see the file COPYING3. If not see
void
selftest::run_tests ()
{
+ /* Makefile.in has -fself-test=$(srcdir)/testsuite/selftests, so that
+ flag_self_test contains the path to the selftest subdirectory of the
+ source tree (without a trailing slash). Copy it up to
+ path_to_selftest_files, to avoid selftest.c depending on
+ option-handling. */
+ path_to_selftest_files = flag_self_test;
+
long start_time = get_run_time ();
/* Run all the tests, in hand-coded order of (approximate) dependencies: