diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-02 00:45:39 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-02 00:48:32 -0500 |
commit | 95e08cc46fb499866f2491b4a8aad9fe29ac6a00 (patch) | |
tree | ca131c3280cebc30bbdb6bf96aa230096e0793e2 /test/RegressTests.py | |
parent | 307b63be77f932ce7cf9685be261f1c3786ea719 (diff) | |
download | fork-ledger-95e08cc46fb499866f2491b4a8aad9fe29ac6a00.tar.gz fork-ledger-95e08cc46fb499866f2491b4a8aad9fe29ac6a00.tar.bz2 fork-ledger-95e08cc46fb499866f2491b4a8aad9fe29ac6a00.zip |
Make the source directory available to all tests
Diffstat (limited to 'test/RegressTests.py')
-rwxr-xr-x | test/RegressTests.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/RegressTests.py b/test/RegressTests.py index 4d23f6b5..13a0a113 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -11,7 +11,7 @@ from difflib import unified_diff from LedgerHarness import LedgerHarness harness = LedgerHarness(sys.argv) -tests = sys.argv[2] +tests = sys.argv[3] if not os.path.isdir(tests) and not os.path.isfile(tests): sys.exit(1) @@ -27,11 +27,15 @@ class RegressFile: line == ">>>2\n" or \ line.startswith("===") + def transform_line(self, line): + line = re.sub('\$sourcepath', harness.sourcepath, line) + return line + def read_section(self): lines = [] line = self.fd.readline() while not self.is_directive(line): - lines.append(line) + lines.append(self.transform_line(line)) line = self.fd.readline() return (lines, line) @@ -60,7 +64,7 @@ class RegressFile: test['exitcode'] = int(match.group(1)) return test else: - test['command'] = line + test['command'] = self.transform_line(line) line = self.fd.readline() return None |