]> granicus.if.org Git - graphviz/commitdiff
fix: teach rtest.py how to find its default files regardless of CWD
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 25 Jan 2021 00:24:28 +0000 (16:24 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 31 Jan 2021 03:22:22 +0000 (19:22 -0800)
If rtest.py is run from a different directory -- e.g. from a top-level make
check-recursive -- it could not find its default inputs.

rtest/rtest.py

index 3bedc80b759721af608106bb0779234748297e71..2af10e1e465875fb1a3b1f06b4d17132672e5b33 100755 (executable)
@@ -18,8 +18,10 @@ import argparse
 import atexit
 import pathlib
 
-TESTFILE = 'tests.txt'                # Test specifications
-GRAPHDIR = 'graphs'                   # Directory of input graphs and data
+TESTFILE = os.path.join(os.path.dirname(__file__), 'tests.txt')
+                                      # Test specifications
+GRAPHDIR = os.path.join(os.path.dirname(__file__), 'graphs')
+                                      # Directory of input graphs and data
 OUTDIR = 'ndata'                      # Directory for test output
 OUTHTML = 'nhtml'                     # Directory for html test report
 REFDIR = os.environ.get('REFDIR', '') # Directory for expected test output