gnucash/libgnucash/gnc-module/test/test-gnc-module-scm-module.scm
John Ralls 6c01e54042 Convert shell-executed scheme tests to run directly from Guile.
I.e., remove the shell invocation and with it the need to set the shebang.

Surprisingly this required some build-system modifications particularly
for cmake in order to correctly set the environment.
2017-11-07 15:04:16 -08:00

15 lines
673 B
Scheme
Executable File

(use-modules (gnucash unittest-support))
(define log-domain "gnc.module")
(define check (new-TestErrorStruct))
(define log-level (G-LOG-LEVEL-WARNING))
(define msg "Module '../../../libgnucash/gnc-module/test/misc-mods/.libs/libgncmod_futuremodsys.so' requires newer module system\n")
(TestErrorStruct-log-domain-set check log-domain)
(TestErrorStruct-log-level-set check log-level)
(TestErrorStruct-msg-set check msg)
(define handler (test-set-checked-handler log-domain log-level check))
(use-modules (gnucash gnc-module))
(gnc:module-system-init)
(if (not (gnc:module-load "gnucash/foo" 0)) (exit -1))
(exit (foo:scheme-hello))
(g-log-remove-handler log-domain handler)