chiark / gitweb /
tests/dtest.py: Maintain a separate test root for each test.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 27 Nov 2017 02:03:52 +0000 (02:03 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 29 Nov 2017 11:47:21 +0000 (11:47 +0000)
Now they can run in parallel without breaking each other, which is nice.
It's nice for two reasons: firstly, Automake changed behaviour and runs
tests in parallel by default nowadays; and secondly, the tests are
rather slow because they involve a bunch of waiting around for things,
and waiting for stuff in parallel is easy.

The downside is that we end up gobbling a lot of disk space with all of
the logfiles.  I think this is a good trade.

tests/dtest.py

index a8ea64cdb526ecc136e269c7596be743a09e17ff..6f9e6a8659526aac515e2e3ee54a95c8db86097e 100644 (file)
@@ -198,7 +198,7 @@ mail_sender no.such.user.sorry@greenend.org.uk
 
 def common_setup():
     remove_dir(testroot)
-    os.mkdir(testroot)
+    os.makedirs(testroot)
     # Choose a port
     global port
     port = random.randint(49152, 65530)
@@ -410,5 +410,6 @@ def command(args):
 tests = 0
 failures = 0
 daemon = None
-testroot = "%s/tests/testroot" % top_builddir
+testroot = "%s/tests/testroot/%s" % \
+           (top_builddir, os.path.basename(sys.argv[0]))
 tracks = "%s/tracks" % testroot