summaryrefslogtreecommitdiff
path: root/test/regress.py
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-20 14:29:28 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-20 15:41:49 -0400
commit42f94d2b8bcbc58abd5e09c0c1e98b8dd167552b (patch)
tree48ce22675748550d6f66d0f28503a34d05d72f15 /test/regress.py
parente05f29bff0c8c566845c06089aa5416a5166914f (diff)
downloadfork-ledger-42f94d2b8bcbc58abd5e09c0c1e98b8dd167552b.tar.gz
fork-ledger-42f94d2b8bcbc58abd5e09c0c1e98b8dd167552b.tar.bz2
fork-ledger-42f94d2b8bcbc58abd5e09c0c1e98b8dd167552b.zip
Added several new baseline tests
Diffstat (limited to 'test/regress.py')
-rwxr-xr-xtest/regress.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/regress.py b/test/regress.py
index aff17687..e8da3f93 100755
--- a/test/regress.py
+++ b/test/regress.py
@@ -14,7 +14,7 @@ tests = sys.argv[2]
if not os.path.isfile(ledger):
sys.exit(1)
-if not os.path.isdir(tests):
+if not os.path.isdir(tests) and not os.path.isfile(tests):
sys.exit(1)
succeeded = 0
@@ -44,7 +44,7 @@ def test_regression(test_file):
else:
tempdata = tempfile.mkstemp()
- os.write(tempdata[0], string.join(data))
+ os.write(tempdata[0], string.join(data, ''))
os.close(tempdata[0])
command = ("%s -f \"%s\" " % (ledger, tempdata[1])) + command
@@ -74,7 +74,6 @@ def test_regression(test_file):
p.stdin.close()
success = True
-
printed = False
index = 0
for line in difflib.unified_diff(output, p.stdout.readlines()):
@@ -119,9 +118,12 @@ def test_regression(test_file):
if not use_stdin:
os.remove(tempdata[1])
-for test in os.listdir(tests):
- if re.search('\.test$', test):
- test_regression(os.path.join(tests, test))
+if os.path.isdir(tests):
+ for test in os.listdir(tests):
+ if re.search('\.test$', test):
+ test_regression(os.path.join(tests, test))
+else:
+ test_regression(tests)
print
if succeeded > 0: