guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: gnucash: Fix test failure.


From: guix-commits
Subject: 01/01: gnu: gnucash: Fix test failure.
Date: Wed, 2 Jan 2019 17:11:21 -0500 (EST)

apteryx pushed a commit to branch master
in repository guix.

commit 707efe171a4e0e542a7d969c130195fa94b5d615
Author: Maxim Cournoyer <address@hidden>
Date:   Wed Jan 2 15:11:06 2019 -0500

    gnu: gnucash: Fix test failure.
    
    Fixes issue #32057 (see: https://issues.guix.info/issue/32057).
    
    * gnu/packages/patches/gnucash-fix-test-transaction-failure.patch: New 
patch.
    * gnu/local.mk (dist_patch_DATA): Register it.
    * gnu/packages/gnucash.scm (gnucash): Use it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/gnucash.scm                           |  3 +-
 .../gnucash-fix-test-transaction-failure.patch     | 54 ++++++++++++++++++++++
 3 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 0bb0203..5f3a4b0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -776,6 +776,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/gnome-tweak-tool-search-paths.patch     \
   %D%/packages/patches/gnucash-price-quotes-perl.patch         \
   %D%/packages/patches/gnucash-disable-failing-tests.patch     \
+  %D%/packages/patches/gnucash-fix-test-transaction-failure.patch \
   %D%/packages/patches/gnutls-skip-trust-store-test.patch      \
   %D%/packages/patches/gnutls-skip-pkgconfig-test.patch                \
   %D%/packages/patches/gobject-introspection-absolute-shlib-path.patch \
diff --git a/gnu/packages/gnucash.scm b/gnu/packages/gnucash.scm
index 4e68f20..b546233 100644
--- a/gnu/packages/gnucash.scm
+++ b/gnu/packages/gnucash.scm
@@ -61,7 +61,8 @@
        (base32
         "0grr5qi5rn1xvr7qx5d7mcxa2mcgycy2b325ry73bb485a6yv5l3"))
       (patches (search-patches "gnucash-price-quotes-perl.patch"
-                               "gnucash-disable-failing-tests.patch"))))
+                               "gnucash-disable-failing-tests.patch"
+                               "gnucash-fix-test-transaction-failure.patch"))))
     (build-system cmake-build-system)
     (inputs
      `(("guile" ,guile-2.2)
diff --git a/gnu/packages/patches/gnucash-fix-test-transaction-failure.patch 
b/gnu/packages/patches/gnucash-fix-test-transaction-failure.patch
new file mode 100644
index 0000000..7b1b29f
--- /dev/null
+++ b/gnu/packages/patches/gnucash-fix-test-transaction-failure.patch
@@ -0,0 +1,54 @@
+# This patch was submitted upstream to: 
https://bugs.gnucash.org/show_bug.cgi?id=797008.
+From c20d74bebca516d0e391724202aad511967fe109 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <address@hidden>
+Date: Wed, 2 Jan 2019 14:46:28 -0500
+Subject: [PATCH] tests: Fix a test failure in test-transaction.scm.
+
+With the New Year upon us, a test which was hard-coded to use 2018 now
+failed.
+
+Fixes issue #797008 (see:
+https://bugs.gnucash.org/show_bug.cgi?id=797008).
+
+* gnucash/report/standard-reports/test/test-transaction.scm:
+(trep-tests): Use the current year in the test string instead of a
+static one.
+---
+ gnucash/report/standard-reports/test/test-transaction.scm | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gnucash/report/standard-reports/test/test-transaction.scm 
b/gnucash/report/standard-reports/test/test-transaction.scm
+index 755aba298..ae3fbd5c1 100644
+--- a/gnucash/report/standard-reports/test/test-transaction.scm
++++ b/gnucash/report/standard-reports/test/test-transaction.scm
+@@ -5,6 +5,7 @@
+ (use-modules (gnucash report stylesheets))
+ (use-modules (gnucash report report-system))
+ (use-modules (gnucash report report-system test test-extras))
++(use-modules (srfi srfi-19))
+ (use-modules (srfi srfi-64))
+ (use-modules (gnucash engine test srfi64-extras))
+ (use-modules (sxml simple))
+@@ -643,7 +644,8 @@
+       (set-option! options "General" "Show original currency amount" #t)
+       (set-option! options "Sorting" "Primary Key" 'date)
+       (set-option! options "Sorting" "Primary Subtotal for Date Key" 'none)
+-      (let* ((sxml (options->sxml options "dual columns")))
++      (let* ((sxml (options->sxml options "dual columns"))
++           (current-year (date->string (current-date) "~y")))
+         (test-equal "dual amount column, with original currency headers"
+           (list "Date" "Num" "Description" "Memo/Notes" "Account"
+                 "Debit (USD)" "Credit (USD)" "Debit" "Credit")
+@@ -652,7 +654,8 @@
+           (list "Grand Total" "$2,280.00" "$2,280.00")
+           (get-row-col sxml -1 #f))
+         (test-equal "dual amount column, first transaction correct"
+-          (list "01/03/18" "$103 income" "Root.Asset.Bank" "$103.00" 
"$103.00")
++          (list (string-append "01/03/" current-year) "$103 income"
++              "Root.Asset.Bank" "$103.00" "$103.00")
+           (get-row-col sxml 1 #f)))
+       )
+ 
+-- 
+2.19.0
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]