summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xacprep5
-rw-r--r--src/draft.cc14
-rw-r--r--src/draft.h9
-rw-r--r--src/xact.cc3
-rwxr-xr-xtest/LedgerHarness.py4
-rwxr-xr-xtest/RegressTests.py3
6 files changed, 26 insertions, 12 deletions
diff --git a/acprep b/acprep
index 0d7f3cd0..4ebd6914 100755
--- a/acprep
+++ b/acprep
@@ -1643,7 +1643,10 @@ class PrepareBuild(CommandLineApp):
isdir(self.build_directory()):
self.log.info('=== Wiping build directory %s ===' %
self.build_directory())
- shutil.rmtree(self.build_directory())
+ try:
+ shutil.rmtree(self.build_directory())
+ except:
+ self.execute('rm', '-fr', self.build_directory())
def phase_distcheck(self, *args):
self.log.info('Executing phase: distcheck')
diff --git a/src/draft.cc b/src/draft.cc
index 7edf7edc..43c214cb 100644
--- a/src/draft.cc
+++ b/src/draft.cc
@@ -507,7 +507,6 @@ value_t template_command(call_scope_t& args)
out << std::endl << std::endl;
draft_t draft(args.value());
-
out << _("--- Transaction template ---") << std::endl;
draft.dump(out);
@@ -517,15 +516,16 @@ value_t template_command(call_scope_t& args)
value_t xact_command(call_scope_t& args)
{
report_t& report(find_scope<report_t>(args));
- draft_t draft(args.value());
+ draft_t draft(args.value());
- xact_t * new_xact = draft.insert(*report.session.journal.get());
+ unique_ptr<xact_t> new_xact(draft.insert(*report.session.journal.get()));
+ if (new_xact.get()) {
+ // Only consider actual postings for the "xact" command
+ report.HANDLER(limit_).on("#xact", "actual");
- // Only consider actual postings for the "xact" command
- report.HANDLER(limit_).on("#xact", "actual");
+ report.xact_report(post_handler_ptr(new print_xacts(report)), *new_xact.get());
+ }
- if (new_xact)
- report.xact_report(post_handler_ptr(new print_xacts(report)), *new_xact);
return true;
}
diff --git a/src/draft.h b/src/draft.h
index 46aa26e1..9023e6da 100644
--- a/src/draft.h
+++ b/src/draft.h
@@ -81,6 +81,15 @@ class draft_t : public expr_base_t<value_t>
xact_template_t() {
TRACE_CTOR(xact_template_t, "");
}
+ xact_template_t(const xact_template_t& other)
+ : date(other.date),
+ code(other.code),
+ note(other.note),
+ payee_mask(other.payee_mask),
+ posts(other.posts)
+ {
+ TRACE_CTOR(xact_template_t, "copy");
+ }
~xact_template_t() throw() {
TRACE_DTOR(xact_template_t);
}
diff --git a/src/xact.cc b/src/xact.cc
index 3f4b753c..226fd5ab 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -56,7 +56,8 @@ xact_base_t::~xact_base_t()
// temporary is.
assert(! post->has_flags(ITEM_TEMP));
- post->account->remove_post(post);
+ if (post->account)
+ post->account->remove_post(post);
checked_delete(post);
}
}
diff --git a/test/LedgerHarness.py b/test/LedgerHarness.py
index 3477e720..3e797e85 100755
--- a/test/LedgerHarness.py
+++ b/test/LedgerHarness.py
@@ -44,8 +44,8 @@ class LedgerHarness:
print "Cannot find source path at '%s'" % argv[2]
sys.exit(1)
- self.ledger = argv[1]
- self.sourcepath = argv[2]
+ self.ledger = os.path.abspath(argv[1])
+ self.sourcepath = os.path.abspath(argv[2])
self.succeeded = 0
self.failed = 0
self.verify = '--verify' in argv
diff --git a/test/RegressTests.py b/test/RegressTests.py
index a7d51ada..792c2d3e 100755
--- a/test/RegressTests.py
+++ b/test/RegressTests.py
@@ -184,7 +184,8 @@ if __name__ == '__main__':
tests = [os.path.join(tests, x)
for x in os.listdir(tests)
if (x.endswith('.test') and
- (not '_py.test' in x or harness.python))]
+ (not '_py.test' in x or (harness.python and
+ not harness.verify)))]
if pool:
pool.map(do_test, tests, 1)
else: