diff tests/test-run-tests.t @ 28180:2836a43c7722

run-tests: allow run-tests.py to run tests outside current directory When reloading tests, run-tests.py was assuming that it could look up the test by the basename, which only works if you are running tests which are in the current directory. This patch changes that lookup to use the full path. This is all that was needed, and does not appear to cause any problems for any of the existing testing work flows based on running the suggested commands at the top of run-tests.py. Motivation: In order to test Mercurial with Hypothesis (according to https://www.mercurial-scm.org/wiki/HypothesisPlan) it is useful to be able to generate temporary test files and execute them. Generating temporary files in the tests/ directory leads to a lot of suboptimal clutter.
author David R. MacIver <david@drmaciver.com>
date Thu, 18 Feb 2016 08:52:15 +0000
parents 562a073a2a1b
children c0cecc153d25
line wrap: on
line diff
--- a/tests/test-run-tests.t	Tue Feb 16 14:49:29 2016 +0000
+++ b/tests/test-run-tests.t	Thu Feb 18 08:52:15 2016 +0000
@@ -718,3 +718,13 @@
   $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t
   .
   # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
+
+support for running a test outside the current directory
+  $ mkdir nonlocal
+  $ cat > nonlocal/test-is-not-here.t << EOF
+  >   $ echo pass
+  >   pass
+  > EOF
+  $ rt nonlocal/test-is-not-here.t
+  .
+  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.