diff options
author | Alexis Hildebrandt <afh@surryhill.net> | 2022-06-30 14:30:21 +0200 |
---|---|---|
committer | Martin Michlmayr <tbm@cyrius.com> | 2022-07-01 11:51:03 +0800 |
commit | 18305fd30df731e27b6e909ea7d846b579f0abc4 (patch) | |
tree | 9a941ccd86ad64ae934e73802a8d4e061272c3cd /test | |
parent | 7424c244d69c386187f6df87d309c1d54f8a435b (diff) | |
download | fork-ledger-18305fd30df731e27b6e909ea7d846b579f0abc4.tar.gz fork-ledger-18305fd30df731e27b6e909ea7d846b579f0abc4.tar.bz2 fork-ledger-18305fd30df731e27b6e909ea7d846b579f0abc4.zip |
Replace os.path.abspath with os.path.realpath
to fix failing tests on Darwin, where /tmp is a symlink to /private/tmp
and the tests fail as ledger reports filenames with the symlink resolved
to /private/tmp, but the tests expect files with /tmp.
Diffstat (limited to 'test')
-rwxr-xr-x | test/CheckOptions.py | 4 | ||||
-rwxr-xr-x | test/DocTests.py | 4 | ||||
-rwxr-xr-x | test/LedgerHarness.py | 4 | ||||
-rwxr-xr-x | test/RegressTests.py | 4 | ||||
-rwxr-xr-x | test/convert.py | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/test/CheckOptions.py b/test/CheckOptions.py index dc865532..bb0b3731 100755 --- a/test/CheckOptions.py +++ b/test/CheckOptions.py @@ -19,8 +19,8 @@ class CheckOptions (object): self.source_file = None self.sep = "\n --" - self.ledger = os.path.abspath(args.ledger) - self.source = os.path.abspath(args.source) + self.ledger = os.path.realpath(args.ledger) + self.source = os.path.realpath(args.source) self.missing_options = set() self.unknown_options = set() diff --git a/test/DocTests.py b/test/DocTests.py index 4814091c..a63ac0d3 100755 --- a/test/DocTests.py +++ b/test/DocTests.py @@ -18,8 +18,8 @@ from difflib import unified_diff class DocTests: def __init__(self, args): scriptpath = os.path.dirname(os.path.realpath(__file__)) - self.ledger = os.path.abspath(args.ledger) - self.sourcepath = os.path.abspath(args.file) + self.ledger = os.path.realpath(args.ledger) + self.sourcepath = os.path.realpath(args.file) self.verbose = args.verbose self.tests = args.examples diff --git a/test/LedgerHarness.py b/test/LedgerHarness.py index 0b4f174d..a23812f0 100755 --- a/test/LedgerHarness.py +++ b/test/LedgerHarness.py @@ -50,8 +50,8 @@ class LedgerHarness: print("Cannot find source path at '%s'" % argv[2]) sys.exit(1) - self.ledger = os.path.abspath(argv[1]) - self.sourcepath = os.path.abspath(argv[2]) + self.ledger = os.path.realpath(argv[1]) + self.sourcepath = os.path.realpath(argv[2]) self.succeeded = 0 self.failed = 0 self.verify = '--verify' in argv diff --git a/test/RegressTests.py b/test/RegressTests.py index b20c0aa6..2aefd80a 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -45,7 +45,7 @@ class RegressFile(object): def transform_line(self, line): line = line.replace('$sourcepath', harness.sourcepath) - line = line.replace('$FILE', os.path.abspath(self.filename)) + line = line.replace('$FILE', os.path.realpath(self.filename)) return line def read_test(self): @@ -117,7 +117,7 @@ class RegressFile(object): use_stdin = True else: test['command'] = (('$ledger -f "%s" ' % - os.path.abspath(self.filename)) + + os.path.realpath(self.filename)) + test['command']) p = harness.run(test['command'], diff --git a/test/convert.py b/test/convert.py index 2ac7a21b..62ea55e7 100755 --- a/test/convert.py +++ b/test/convert.py @@ -36,9 +36,9 @@ import re import sys import os -source = os.path.abspath(sys.argv[1]) +source = os.path.realpath(sys.argv[1]) base = os.path.splitext(source)[0] -target = os.path.abspath(sys.argv[2]) +target = os.path.realpath(sys.argv[2]) dirname = os.path.dirname(target) if not os.path.isdir(dirname): |