gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Sat Sep 21 07:39:36 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/cda11dbd (commit)
	 via  https://github.com/Gnucash/gnucash/commit/24393b6f (commit)
	from  https://github.com/Gnucash/gnucash/commit/496ca94a (commit)



commit cda11dbd6f082c08a4cd6f6cc780d6511d9b8b1b
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Sep 21 18:20:05 2019 +0800

    [test-account-summary] initial commit

diff --git a/gnucash/report/standard-reports/test/CMakeLists.txt b/gnucash/report/standard-reports/test/CMakeLists.txt
index 4b5994550..97b09f68a 100644
--- a/gnucash/report/standard-reports/test/CMakeLists.txt
+++ b/gnucash/report/standard-reports/test/CMakeLists.txt
@@ -9,6 +9,7 @@ set(scm_test_with_srfi64_SOURCES
   test-cashflow-barchart.scm
   test-charts.scm
   test-transaction.scm
+  test-account-summary.scm
   test-balsheet-pnl.scm
   test-income-gst.scm
   test-budget.scm
diff --git a/gnucash/report/standard-reports/test/test-account-summary.scm b/gnucash/report/standard-reports/test/test-account-summary.scm
new file mode 100644
index 000000000..e09e79e60
--- /dev/null
+++ b/gnucash/report/standard-reports/test/test-account-summary.scm
@@ -0,0 +1,82 @@
+(use-modules (gnucash gnc-module))
+(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash engine test test-extras))
+(use-modules (gnucash report standard-reports account-summary))
+(use-modules (gnucash report standard-reports sx-summary))
+(use-modules (gnucash report stylesheets))
+(use-modules (gnucash report report-system))
+(use-modules (gnucash report report-system test test-extras))
+(use-modules (srfi srfi-64))
+(use-modules (gnucash engine test srfi64-extras))
+(use-modules (sxml simple))
+(use-modules (sxml xpath))
+
+(define accsum-uuid "3298541c236b494998b236dfad6ad752")
+(define fsts-uuid "47f45d7d6d57b68518481c1fc8d4e4ba")
+
+;; Explicitly set locale to make the report output predictable
+(setlocale LC_ALL "C")
+
+(define (run-test)
+  (test-runner-factory gnc:test-runner)
+  (test-setup)
+  (test-begin "accsum-and-fsts")
+  (accsum-tests)
+  (test-end "accsum-and-fsts"))
+
+(define (test-setup)
+  (define (mnemonic->commodity sym)
+    (gnc-commodity-table-lookup
+     (gnc-commodity-table-get-table (gnc-get-current-book))
+     (gnc-commodity-get-namespace (gnc-default-report-currency))
+     sym))
+  (define GBP (mnemonic->commodity "GBP"))
+  (gnc-commodity-set-user-symbol GBP "#"))
+
+(define (options->sxml uuid options test-title)
+  (gnc:options->sxml uuid options "test-accsum" test-title))
+
+(define (set-option! options section name value)
+  (let ((option (gnc:lookup-option options section name)))
+    (if option
+        (gnc:option-set-value option value)
+        (test-assert (format #f "wrong-option ~a ~a" section name) #f))))
+
+(define (accsum-tests)
+  (let* ((account-alist (create-test-data))
+         (income (assoc-ref "Income" account-alist)))
+
+    (define (default-testing-options uuid)
+      (gnc:make-report-options uuid))
+
+
+    (test-begin "account-summary")
+    (let* ((options (default-testing-options accsum-uuid))
+           (sxml (options->sxml accsum-uuid options "accsum")))
+      (test-equal "accsum col 1"
+        '("Code" "#608.00" "-#612.00" "#608.00" "-#612.00" "#608.00" "-#612.00")
+        (sxml->table-row-col sxml 1 #f 1))
+      (test-equal "accsum col 2"
+        '("Account title" "Root" "Asset" "Bank" "GBP Bank" "Wallet"
+          "Liabilities" "Income" "Income-GBP" "Expenses" "Equity")
+        (sxml->table-row-col sxml 1 #f 2))
+      (test-equal "accsum col 3"
+        '("$2,186.00" "#608.00" "$912.00" "$912.00" "$20.00"
+          "-$918.00" "$912.00" "-$918.00" "$912.00" "-$918.00")
+        (sxml->table-row-col sxml 1 #f 3)))
+    (test-end "account-summary")
+
+    (test-begin "fsts")
+    (let* ((options (default-testing-options fsts-uuid))
+           (sxml (options->sxml fsts-uuid options "fsts")))
+      (test-equal "fsts col 1"
+        '("Code")
+        (sxml->table-row-col sxml 1 #f 1))
+      (test-equal "fsts col 2"
+        '("Account title" "Root" "Asset" "Bank" "GBP Bank" "Wallet"
+          "Liabilities" "Income" "Income-GBP" "Expenses" "Equity")
+        (sxml->table-row-col sxml 1 #f 2))
+      (test-equal "fsts col 3"
+        '("$0.00" "$0.00" "$0.00")
+        (sxml->table-row-col sxml 1 #f 3)))
+    (test-end "fsts")))

commit 24393b6f5c31d55b939c9c3366b9f4848d484d54
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Sep 21 14:51:59 2019 +0800

    [utilities] fix comment use official gnu mail archive

diff --git a/libgnucash/scm/utilities.scm b/libgnucash/scm/utilities.scm
index 6665f1b97..574097558 100644
--- a/libgnucash/scm/utilities.scm
+++ b/libgnucash/scm/utilities.scm
@@ -174,7 +174,7 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; avoid using strftime, still broken in guile-2.2. see explanation at
-;; https://www.mail-archive.com/bug-guile@gnu.org/msg09778.html
+;; https://lists.gnu.org/archive/html/bug-guile/2019-05/msg00003.html
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (let ((strftime-old strftime))
   (set! strftime



Summary of changes:
 .../report/standard-reports/test/CMakeLists.txt    |  1 +
 .../standard-reports/test/test-account-summary.scm | 82 ++++++++++++++++++++++
 libgnucash/scm/utilities.scm                       |  2 +-
 3 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 gnucash/report/standard-reports/test/test-account-summary.scm



More information about the gnucash-changes mailing list