summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/LedgerHarness.py7
-rw-r--r--test/baseline/opt-day-break.test12
-rw-r--r--test/baseline/opt-verify-memory.test0
-rwxr-xr-xtest/fullcheck.sh20
-rw-r--r--test/regress/1384C1D8.test27
-rw-r--r--test/regress/14DB77E7.test2
-rw-r--r--test/regress/25A099C9.test42
-rw-r--r--test/regress/96A8E4A1.test10
-rw-r--r--test/regress/9E0E606D.test19
-rw-r--r--test/regress/A8FCC765.dat2
-rw-r--r--test/regress/A8FCC765.test8
11 files changed, 117 insertions, 32 deletions
diff --git a/test/LedgerHarness.py b/test/LedgerHarness.py
index 564a4d32..3477e720 100755
--- a/test/LedgerHarness.py
+++ b/test/LedgerHarness.py
@@ -81,6 +81,13 @@ class LedgerHarness:
command = re.sub('\$ledger', '%s%s %s' % \
(self.ledger, insert, '--args-only'), command)
+ valgrind = '/usr/bin/valgrind'
+ if not os.path.isfile(valgrind):
+ valgrind = '/opt/local/bin/valgrind'
+
+ if os.path.isfile(valgrind) and '--verify' in insert:
+ command = valgrind + ' -q ' + command
+
return Popen(command, shell=True, close_fds=True, env=env,
stdin=PIPE, stdout=PIPE, stderr=PIPE)
diff --git a/test/baseline/opt-day-break.test b/test/baseline/opt-day-break.test
new file mode 100644
index 00000000..18dde546
--- /dev/null
+++ b/test/baseline/opt-day-break.test
@@ -0,0 +1,12 @@
+i 05/10/2011 08:58:37 682
+o 05/12/2011 11:25:21
+
+test reg --base
+11-May-10 (682) 181604s 181604s
+end test
+
+test reg --base --day-break
+11-May-10 (682) 54083s 54083s
+11-May-11 (682) 86400s 140483s
+11-May-12 (682) 41121s 181604s
+end test
diff --git a/test/baseline/opt-verify-memory.test b/test/baseline/opt-verify-memory.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-verify-memory.test
diff --git a/test/fullcheck.sh b/test/fullcheck.sh
index f8c671e0..db63921d 100755
--- a/test/fullcheck.sh
+++ b/test/fullcheck.sh
@@ -2,17 +2,17 @@
VALGRIND=''
if [ -x /usr/bin/valgrind -o -x /opt/local/bin/valgrind ]; then
- VALGRIND=valgrind
+ VALGRIND="valgrind -q"
fi
-export MallocGuardEdges=1
-export MallocScribble=1
-export MallocPreScribble=1
-export MallocCheckHeapStart=100
-export MallocCheckHeapEach=100
-export DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib
-export MALLOC_PROTECT_BEFORE=1
-export MALLOC_FILL_SPACE=1
-export MALLOC_STRICT_SIZE=1
+#export MallocGuardEdges=1
+#export MallocScribble=1
+#export MallocPreScribble=1
+#export MallocCheckHeapStart=100
+#export MallocCheckHeapEach=100
+#export DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib
+#export MALLOC_PROTECT_BEFORE=1
+#export MALLOC_FILL_SPACE=1
+#export MALLOC_STRICT_SIZE=1
exec $VALGRIND $@
diff --git a/test/regress/1384C1D8.test b/test/regress/1384C1D8.test
new file mode 100644
index 00000000..77a07b7a
--- /dev/null
+++ b/test/regress/1384C1D8.test
@@ -0,0 +1,27 @@
+@alias OLD1 = NEW1
+
+2012-01-01 Something
+ OLD1 $10.00
+ Other
+
+!alias OLD2 = NEW2
+
+2012-01-01 Something
+ OLD2 $10.00
+ Other
+
+account NEW3
+ alias OLD3
+
+2012-01-01 Something
+ OLD3 $10.00
+ Other
+
+test bal
+ $10.00 NEW1
+ $10.00 NEW2
+ $10.00 NEW3
+ $-30.00 Other
+--------------------
+ 0
+end test
diff --git a/test/regress/14DB77E7.test b/test/regress/14DB77E7.test
index ee155afb..4d8734f9 100644
--- a/test/regress/14DB77E7.test
+++ b/test/regress/14DB77E7.test
@@ -13,6 +13,6 @@ P 2011-02-01 EUR 0.8576 GBP
test reg income:adse -X GBP -H
11-Jan-31 AdSense earnings Income:AdSense -11.00 EUR -11.00 EUR
-11-Feb-01 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP
+11-Feb-28 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP
11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.01 GBP
end test
diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test
index df4fef1c..a8a93832 100644
--- a/test/regress/25A099C9.test
+++ b/test/regress/25A099C9.test
@@ -1,43 +1,43 @@
-test -f $sourcepath/src/amount.h reg -> 20
+test -f src/amount.h reg -> 20
__ERROR__
-While parsing file "$sourcepath/src/amount.h", line 2:
+While parsing file "src/amount.h", line 2:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 33:
+While parsing file "src/amount.h", line 33:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 37:
+While parsing file "src/amount.h", line 37:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 66:
+While parsing file "src/amount.h", line 66:
Error: No quantity specified for amount
-While parsing file "$sourcepath/src/amount.h", line 69:
+While parsing file "src/amount.h", line 69:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 83:
+While parsing file "src/amount.h", line 83:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 93:
+While parsing file "src/amount.h", line 93:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 99:
+While parsing file "src/amount.h", line 99:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 121:
+While parsing file "src/amount.h", line 121:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 132:
+While parsing file "src/amount.h", line 132:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 693:
+While parsing file "src/amount.h", line 693:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 723:
+While parsing file "src/amount.h", line 723:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 731:
+While parsing file "src/amount.h", line 731:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/src/amount.h", line 734:
+While parsing file "src/amount.h", line 734:
Error: Invalid date/time: line amount_t amoun
-While parsing file "$sourcepath/src/amount.h", line 740:
+While parsing file "src/amount.h", line 740:
Error: Invalid date/time: line string amount_
-While parsing file "$sourcepath/src/amount.h", line 746:
+While parsing file "src/amount.h", line 746:
Error: Invalid date/time: line string amount_
-While parsing file "$sourcepath/src/amount.h", line 752:
+While parsing file "src/amount.h", line 752:
Error: Invalid date/time: line string amount_
-While parsing file "$sourcepath/src/amount.h", line 758:
+While parsing file "src/amount.h", line 758:
Error: Invalid date/time: line std::ostream&
-While parsing file "$sourcepath/src/amount.h", line 765:
+While parsing file "src/amount.h", line 765:
Error: Invalid date/time: line std::istream&
-While parsing file "$sourcepath/src/amount.h", line 771:
+While parsing file "src/amount.h", line 771:
Error: Unexpected whitespace at beginning of line
end test
diff --git a/test/regress/96A8E4A1.test b/test/regress/96A8E4A1.test
new file mode 100644
index 00000000..93fb55d2
--- /dev/null
+++ b/test/regress/96A8E4A1.test
@@ -0,0 +1,10 @@
+2011-01-31 * Test
+ Expenses:Travel 1 "Spr MegaBonus"
+ Assets:Voucher
+
+test -X EUR -H bal
+ -1 "Spr MegaBonus" Assets:Voucher
+ 1 "Spr MegaBonus" Expenses:Travel
+--------------------
+ 0
+end test
diff --git a/test/regress/9E0E606D.test b/test/regress/9E0E606D.test
new file mode 100644
index 00000000..86b8e36f
--- /dev/null
+++ b/test/regress/9E0E606D.test
@@ -0,0 +1,19 @@
+D 1000.00 GBP
+
+P 2011-02-01 EUR 0.8576 GBP
+P 2011-03-01 EUR 0.8612 GBP
+P 2011-04-01 EUR 0.8510 GBP
+
+2011-01-31 * AdSense earnings
+ Assets:Receivable:AdSense 11.00 EUR
+ Income:AdSense
+
+2011-02-28 * AdSense earnings
+ Assets:Receivable:AdSense 10.00 EUR
+ Income:AdSense
+
+test reg income:ad -X GBP -H
+11-Jan-31 AdSense earnings Income:AdSense -11.00 EUR -11.00 EUR
+11-Feb-28 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP
+11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.01 GBP
+end test
diff --git a/test/regress/A8FCC765.dat b/test/regress/A8FCC765.dat
new file mode 100644
index 00000000..abc51a0a
--- /dev/null
+++ b/test/regress/A8FCC765.dat
@@ -0,0 +1,2 @@
+P 2012-03-16 06:47:12 CAD $2.50
+P 2012-03-17 06:47:12 CAD $3.50
diff --git a/test/regress/A8FCC765.test b/test/regress/A8FCC765.test
new file mode 100644
index 00000000..1adf6053
--- /dev/null
+++ b/test/regress/A8FCC765.test
@@ -0,0 +1,8 @@
+2012-03-17 KFC
+ Expenses:Food 20 CAD
+ Assets:Cash
+
+test pricedb --price-db test/regress/A8FCC765.dat
+P 2012/03/16 06:47:12 CAD $2.5
+P 2012/03/17 06:47:12 CAD $3.5
+end test