diff options
author | John Wiegley <johnw@newartisans.com> | 2012-04-25 03:08:45 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-04-25 03:09:56 -0500 |
commit | a910549ca9f7d07d7610eb27d8b0709dc42802a6 (patch) | |
tree | 4035c2b0632fb66fc9215b6ea1537da35b383c1e | |
parent | 548af968f6a45e42937dd35f70fc601dee8bb38c (diff) | |
download | fork-ledger-a910549ca9f7d07d7610eb27d8b0709dc42802a6.tar.gz fork-ledger-a910549ca9f7d07d7610eb27d8b0709dc42802a6.tar.bz2 fork-ledger-a910549ca9f7d07d7610eb27d8b0709dc42802a6.zip |
Fixes so that tests can run under distcheck
-rwxr-xr-x | test/LedgerHarness.py | 5 | ||||
-rwxr-xr-x | test/RegressTests.py | 7 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/LedgerHarness.py b/test/LedgerHarness.py index 3e797e85..b8900971 100755 --- a/test/LedgerHarness.py +++ b/test/LedgerHarness.py @@ -52,8 +52,6 @@ class LedgerHarness: self.gmalloc = '--gmalloc' in argv self.python = '--python' in argv - os.chdir(self.sourcepath) - def run(self, command, verify=None, gmalloc=None, columns=True): env = os.environ.copy() @@ -89,7 +87,8 @@ class LedgerHarness: command = valgrind + ' -q ' + command return Popen(command, shell=True, close_fds=True, env=env, - stdin=PIPE, stdout=PIPE, stderr=PIPE) + stdin=PIPE, stdout=PIPE, stderr=PIPE, + cwd=self.sourcepath) def read(self, fd): text = "" diff --git a/test/RegressTests.py b/test/RegressTests.py index 792c2d3e..7d67eb21 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -42,7 +42,7 @@ class RegressFile(object): def transform_line(self, line): line = re.sub('\$sourcepath', harness.sourcepath, line) - line = re.sub('\$FILE', self.filename, line) + line = re.sub('\$FILE', os.path.abspath(self.filename), line) return line def read_test(self): @@ -93,7 +93,7 @@ class RegressFile(object): def notify_user(self, msg, test): print msg print "--" - print test['command'], + print self.transform_line(test['command']), print "--" def run_test(self, test): @@ -101,7 +101,8 @@ class RegressFile(object): if test['command'].find("-f - ") != -1: use_stdin = True else: - test['command'] = (('$ledger -f "%s" ' % self.filename) + + test['command'] = (('$ledger -f "%s" ' % + os.path.abspath(self.filename)) + test['command']) p = harness.run(test['command'], |