[PATCH 1 of 2] runtests: rename 'run-tests.py' to Mercurial style 'runtests'

Mads Kiilerich mads at kiilerich.com
Mon Jan 14 19:23:18 CST 2013


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1358212950 -3600
# Node ID 9f036303309a2af199832165ba00b24b8a4df16f
# Parent  cf5c76017e11ed711d02824117baf770e45c2655
runtests: rename 'run-tests.py' to Mercurial style 'runtests'

The '-' is inconsistent with the general preference in Mercurial, and the '.py'
is just inconvenient and cause inconsistency when referring to the tool. It had
'-' in the name and could thus not be used as a Python module anyway.

This makes it less obvious that it can be run as 'python2x runtests' ... but
those who want to do that can figure it out.

It is slightly inconvenient that buildbots, command line histories and fingers
has to be re-trained.

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -89,10 +89,10 @@ dist-notests:	doc MANIFEST.in
 check: tests
 
 tests:
-	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
+	cd tests && $(PYTHON) runtests $(TESTFLAGS)
 
 test-%:
-	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
+	cd tests && $(PYTHON) runtests $(TESTFLAGS) $@
 
 update-pot: i18n/hg.pot
 
diff --git a/tests/README b/tests/README
--- a/tests/README
+++ b/tests/README
@@ -1,7 +1,7 @@
 To run the tests, do:
 
 cd tests/
-python run-tests.py
+python runtests
 
 See http://mercurial.selenic.com/wiki/WritingTests for
 more information on writing tests.
diff --git a/tests/blacklists/README b/tests/blacklists/README
--- a/tests/blacklists/README
+++ b/tests/blacklists/README
@@ -1,8 +1,8 @@
-Put here definitions of blacklists for run-tests.py
+Put here definitions of blacklists for runtests
 
 Create a file per blacklist. Each file should list the names of tests that you
 want to be skipped.
-File names are meant to be used as targets for run-tests.py --blacklist
+File names are meant to be used as targets for runtests --blacklist
 option.
 Lines starting with # are ignored. White spaces are stripped.
 
@@ -10,5 +10,5 @@ e.g. if you create a blacklist/example f
  test-hgrc
  # some comment
  test-help
-then calling "run-tests.py --blacklist blacklists/example" will exclude
+then calling "runtests --blacklist blacklists/example" will exclude
 test-hgrc and test-help from the list of tests to run.
diff --git a/tests/run-tests.py b/tests/runtests
rename from tests/run-tests.py
rename to tests/runtests
--- a/tests/run-tests.py
+++ b/tests/runtests
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# run-tests.py - Run a set of tests on Mercurial
+# runtests - Run a set of tests on Mercurial
 #
 # Copyright 2006 Matt Mackall <mpm at selenic.com>
 #
@@ -18,23 +18,23 @@
 # sample of test scripts.  For example:
 #
 #  1) serial, no coverage, temp install:
-#      ./run-tests.py test-s*
+#      ./runtests test-s*
 #  2) serial, no coverage, local hg:
-#      ./run-tests.py --local test-s*
+#      ./runtests --local test-s*
 #  3) serial, coverage, temp install:
-#      ./run-tests.py -c test-s*
+#      ./runtests -c test-s*
 #  4) serial, coverage, local hg:
-#      ./run-tests.py -c --local test-s*      # unsupported
+#      ./runtests -c --local test-s*      # unsupported
 #  5) parallel, no coverage, temp install:
-#      ./run-tests.py -j2 test-s*
+#      ./runtests -j2 test-s*
 #  6) parallel, no coverage, local hg:
-#      ./run-tests.py -j2 --local test-s*
+#      ./runtests -j2 --local test-s*
 #  7) parallel, coverage, temp install:
-#      ./run-tests.py -j2 -c test-s*          # currently broken
+#      ./runtests -j2 -c test-s*          # currently broken
 #  8) parallel, coverage, local install:
-#      ./run-tests.py -j2 -c --local test-s*  # unsupported (and broken)
+#      ./runtests -j2 -c --local test-s*  # unsupported (and broken)
 #  9) parallel, custom tmp dir:
-#      ./run-tests.py -j2 --tmpdir /tmp/myhgtests
+#      ./runtests -j2 --tmpdir /tmp/myhgtests
 #
 # (You could use any subset of the tests: test-s* happens to match
 # enough that it's worth doing parallel runs, few enough that it
@@ -452,7 +452,7 @@ def installhg(options):
 
     hgbat = os.path.join(BINDIR, 'hg.bat')
     if os.path.isfile(hgbat):
-        # hg.bat expects to be put in bin/scripts while run-tests.py
+        # hg.bat expects to be put in bin/scripts while runtests
         # installation layout put it in bin/ directly. Fix it
         f = open(hgbat, 'rb')
         data = f.read()
@@ -1323,7 +1323,7 @@ def main():
         os.environ["PATH"] = os.pathsep.join(path)
 
         # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
-        # can run .../tests/run-tests.py test-foo where test-foo
+        # can run .../tests/runtests test-foo where test-foo
         # adds an extension to HGRC
         pypath = [PYTHONDIR, TESTDIR]
         # We have to augment PYTHONPATH, rather than simply replacing
diff --git a/tests/test-symlink-os-yes-fs-no.py b/tests/test-symlink-os-yes-fs-no.py
--- a/tests/test-symlink-os-yes-fs-no.py
+++ b/tests/test-symlink-os-yes-fs-no.py
@@ -6,7 +6,7 @@ BUNDLEPATH = os.path.join(TESTDIR, 'bund
 
 # only makes sense to test on os which supports symlinks
 if not getattr(os, "symlink", False):
-    sys.exit(80) # SKIPPED_STATUS defined in run-tests.py
+    sys.exit(80) # SKIPPED_STATUS defined in runtests
 
 u = ui.ui()
 # hide outer repo


More information about the Mercurial-devel mailing list