tests: use compiled addons in func tests, much quicker

This commit is contained in:
Simon Michael 2017-03-28 18:38:36 -07:00
parent 6eb211aa6c
commit 5a7f74c6ff
4 changed files with 17 additions and 17 deletions

View File

@ -1,7 +1,7 @@
# Test budget addon
# Rewrite rules within journal always applied
runghc ../../bin/hledger-budget.hs bal -f - --no-total -DH budget
../../bin/hledger-budget bal -f - --no-total -DH budget
<<<
= ^assets:bank$ date:2017/1 amt:<0
assets:bank *0.008
@ -46,7 +46,7 @@ Ending balances (historical) in 2016/12/31-2017/01/02:
>>>=0
# Rewrite rules can chain one another according to order of definition
runghc ../../bin/hledger-budget.hs reg -f -
../../bin/hledger-budget reg -f -
<<<
; unfortunately date override in posting comment doesn't work
@ -116,7 +116,7 @@ runghc ../../bin/hledger-budget.hs reg -f -
# Periodical transactions within journal being applied with inverted sign in amounts
# As well, accounts from periodic transaction being used for bucketing
runghc ../../bin/hledger-budget.hs bal -f - --no-total -DH expenses
../../bin/hledger-budget bal -f - --no-total -DH expenses
<<<
~ daily from 2016/12/31
expenses:food $8
@ -165,7 +165,7 @@ Ending balances (historical) in 2016/12/26-2017/01/04:
>>>=0
# We still can disable bucketing keeping rewrites and budget offset
runghc ../../bin/hledger-budget.hs bal -f - --no-total --no-buckets -DH expenses
../../bin/hledger-budget bal -f - --no-total --no-buckets -DH expenses
<<<
~ daily from 2016/12/31
expenses:food $8
@ -200,7 +200,7 @@ Ending balances (historical) in 2016/12/31-2017/01/01:
# We can disable offset keeping rewrites and bucketing
# Note that original account names used for query
runghc ../../bin/hledger-budget.hs bal -f - --no-total --no-offset -DH expenses
../../bin/hledger-budget bal -f - --no-total --no-offset -DH expenses
<<<
~ daily from 2016/12/31
expenses:food $8
@ -231,7 +231,7 @@ Ending balances (historical) in 2016/12/31-2017/01/01:
>>>=0
# We can keep just rewrites
runghc ../../bin/hledger-budget.hs bal -f - --no-total --no-buckets --no-offset -DH expenses
../../bin/hledger-budget bal -f - --no-total --no-buckets --no-offset -DH expenses
<<<
~ daily from 2016/12/31
expenses:food $8

View File

@ -1,7 +1,7 @@
# Tests for equity addon
# Simple case
runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
../../bin/hledger-equity -f- -p 2016 assets liabilities
<<<
2016/1/1 open
assets:bank $100
@ -35,7 +35,7 @@ runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
>>>=0
# Test aggregation of postings with prices
runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
../../bin/hledger-equity -f- -p 2016 assets liabilities
<<<
Y2016
01/31
@ -71,7 +71,7 @@ Y2016
>>>=0
# Verify effect of period
runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
../../bin/hledger-equity -f- -p 2016 assets liabilities
<<<
2015/12/31 open
assets:bank $100
@ -104,7 +104,7 @@ runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
# # Tear transaction across periods
# # TODO: clarify what should we see for this case
# runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
# ../../bin/hledger-equity -f- -p 2016 assets liabilities
# <<<
# 2016/1/1 open
# assets:bank $100

View File

@ -1,7 +1,7 @@
# Test prices addon
# by default only market prices are reported
runghc ../../bin/hledger-prices.hs -f-
../../bin/hledger-prices -f-
<<<
P 2016/1/1 EUR $1.06
P 2016/2/1 EUR $1.05
@ -21,7 +21,7 @@ P 2016-02-01 EUR $1.05
>>>=0
# costs from postings can be included also
runghc ../../bin/hledger-prices.hs -f- --costs
../../bin/hledger-prices -f- --costs
<<<
P 2016/1/1 EUR $1.06
P 2016/2/1 EUR $1.05

View File

@ -1,7 +1,7 @@
# Tests for rewrite addon
# Add proportional income tax (from documentation)
runghc ../../bin/hledger-rewrite.hs -f- ^income --add-posting '(liabilities:tax) *.33 ; income tax'
../../bin/hledger-rewrite -f- ^income --add-posting '(liabilities:tax) *.33 ; income tax'
<<<
2016/1/1 paycheck
income:remuneration $-100
@ -27,7 +27,7 @@ runghc ../../bin/hledger-rewrite.hs -f- ^income --add-posting '(liabilities:tax)
>>>=0
# Duplicate posting for budgeting (from documentation)
runghc ../../bin/hledger-rewrite.hs -f- expenses:gifts --add-posting '(budget:gifts) *-1'
../../bin/hledger-rewrite -f- expenses:gifts --add-posting '(budget:gifts) *-1'
<<<
2016/1/1 withdraw
assets:cash $20
@ -50,7 +50,7 @@ runghc ../../bin/hledger-rewrite.hs -f- expenses:gifts --add-posting '(budget:gi
>>>=0
# Add absolute bank processing fee
runghc ../../bin/hledger-rewrite.hs -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' --add-posting 'assets:bank $-5'
../../bin/hledger-rewrite -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' --add-posting 'assets:bank $-5'
<<<
2016/1/1 withdraw
assets:cash $20
@ -81,7 +81,7 @@ runghc ../../bin/hledger-rewrite.hs -f- assets:bank and 'amt:<0' --add-posting '
>>>=0
# Rewrite rule within journal
runghc ../../bin/hledger-rewrite.hs -f- date:2017/1 --add-posting 'Here comes Santa $0'
../../bin/hledger-rewrite -f- date:2017/1 --add-posting 'Here comes Santa $0'
<<<
= ^assets:bank$ date:2017/1 amt:<0
assets:bank *0.008
@ -148,7 +148,7 @@ runghc ../../bin/hledger-rewrite.hs -f- date:2017/1 --add-posting 'Here comes S
>>>=0
# Rewrite using diff output
runghc ../../bin/hledger-rewrite.hs --diff -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' --add-posting 'assets:bank $-5'
../../bin/hledger-rewrite --diff -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' --add-posting 'assets:bank $-5'
<<<
2016/01/01 withdraw
assets:cash $20