r23444 - gnucash/trunk/src - Fix several test failures under guile 2 with auto compile enabled

Geert Janssens gjanssens at code.gnucash.org
Tue Nov 26 08:38:35 EST 2013


Author: gjanssens
Date: 2013-11-26 08:38:34 -0500 (Tue, 26 Nov 2013)
New Revision: 23444
Trac: http://svn.gnucash.org/trac/changeset/23444

Modified:
   gnucash/trunk/src/app-utils/test/test-load-module
   gnucash/trunk/src/report/report-gnome/test/test-load-module
   gnucash/trunk/src/report/standard-reports/test/test-standard-category-report.scm
   gnucash/trunk/src/report/standard-reports/test/test-standard-net-barchart.scm
   gnucash/trunk/src/report/standard-reports/test/test-standard-net-linechart.scm
Log:
Fix several test failures under guile 2 with auto compile enabled

Modified: gnucash/trunk/src/app-utils/test/test-load-module
===================================================================
--- gnucash/trunk/src/app-utils/test/test-load-module	2013-11-26 09:51:51 UTC (rev 23443)
+++ gnucash/trunk/src/app-utils/test/test-load-module	2013-11-26 13:38:34 UTC (rev 23444)
@@ -7,7 +7,19 @@
 (use-modules (gnucash gnc-module))
 (gnc:module-system-init)
 
-(if (gnc:module-load "gnucash/app-utils" 0)
+;; Guile 2 needs to load external modules at compile time
+;; otherwise the N_ syntax-rule won't be found at compile time
+;; causing the test to fail
+;; That's what the wrapper below is meant for:
+(cond-expand
+   (guile-2
+    (define-syntax-rule (begin-for-syntax form ...)
+      (eval-when (load compile eval) (begin form ...))))
+   (else
+    (define begin-for-syntax begin)))
+
+(begin-for-syntax (define loaded-module (gnc:module-load "gnucash/app-utils" 0)))
+(if loaded-module
     (display "Module gnucash/app-utils loaded successfully\n")
     (begin
       (display "Failed - module gnucash/app-utils not loaded successfully\n")

Modified: gnucash/trunk/src/report/report-gnome/test/test-load-module
===================================================================
--- gnucash/trunk/src/report/report-gnome/test/test-load-module	2013-11-26 09:51:51 UTC (rev 23443)
+++ gnucash/trunk/src/report/report-gnome/test/test-load-module	2013-11-26 13:38:34 UTC (rev 23444)
@@ -6,7 +6,8 @@
 (debug-enable 'backtrace)
 
 (debug-set! stack 500000)
-(debug-set! maxdepth 10000)
+(if (< (string->number (major-version)) 2)
+    (debug-set! maxdepth 100000))
 
 (display "  testing report module load ... ")
 (use-modules (ice-9 syncase))

Modified: gnucash/trunk/src/report/standard-reports/test/test-standard-category-report.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/test/test-standard-category-report.scm	2013-11-26 09:51:51 UTC (rev 23443)
+++ gnucash/trunk/src/report/standard-reports/test/test-standard-category-report.scm	2013-11-26 13:38:34 UTC (rev 23444)
@@ -2,10 +2,21 @@
 (use-modules (ice-9 format))
 (use-modules (ice-9 streams))
 (use-modules (srfi srfi-1))
-
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report/report-system" 0)
 
+;; Guile 2 needs to load external modules at compile time
+;; otherwise the N_ syntax-rule won't be found at compile time
+;; causing the test to fail
+;; That's what the wrapper below is meant for:
+(cond-expand
+   (guile-2
+    (define-syntax-rule (begin-for-syntax form ...)
+      (eval-when (load compile eval) (begin form ...))))
+   (else
+    (define begin-for-syntax begin)))
+
+(begin-for-syntax (gnc:module-load "gnucash/report/report-system" 0))
+
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash printf))
 (use-modules (gnucash report report-system))

Modified: gnucash/trunk/src/report/standard-reports/test/test-standard-net-barchart.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/test/test-standard-net-barchart.scm	2013-11-26 09:51:51 UTC (rev 23443)
+++ gnucash/trunk/src/report/standard-reports/test/test-standard-net-barchart.scm	2013-11-26 13:38:34 UTC (rev 23444)
@@ -2,7 +2,19 @@
 ;(use-modules (gnucash report new-reports reports-2))
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report/report-system" 0)
+
+;; Guile 2 needs to load external modules at compile time
+;; otherwise the N_ syntax-rule won't be found at compile time
+;; causing the test to fail
+;; That's what the wrapper below is meant for:
+(cond-expand
+   (guile-2
+    (define-syntax-rule (begin-for-syntax form ...)
+      (eval-when (load compile eval) (begin form ...))))
+   (else
+    (define begin-for-syntax begin)))
+
+(begin-for-syntax (gnc:module-load "gnucash/report/report-system" 0))
 (use-modules (gnucash engine))
 (use-modules (sw_engine))
 

Modified: gnucash/trunk/src/report/standard-reports/test/test-standard-net-linechart.scm
===================================================================
--- gnucash/trunk/src/report/standard-reports/test/test-standard-net-linechart.scm	2013-11-26 09:51:51 UTC (rev 23443)
+++ gnucash/trunk/src/report/standard-reports/test/test-standard-net-linechart.scm	2013-11-26 13:38:34 UTC (rev 23444)
@@ -2,7 +2,19 @@
 ;(use-modules (gnucash report new-reports reports-2))
 
 (use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/report/report-system" 0)
+
+;; Guile 2 needs to load external modules at compile time
+;; otherwise the N_ syntax-rule won't be found at compile time
+;; causing the test to fail
+;; That's what the wrapper below is meant for:
+(cond-expand
+   (guile-2
+    (define-syntax-rule (begin-for-syntax form ...)
+      (eval-when (load compile eval) (begin form ...))))
+   (else
+    (define begin-for-syntax begin)))
+
+(begin-for-syntax (gnc:module-load "gnucash/report/report-system" 0))
 (use-modules (gnucash engine))
 (use-modules (sw_engine))
 



More information about the gnucash-changes mailing list