unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Help with modules and unit tests
@ 2023-12-08  6:59 Nikolaos Chatzikonstantinou
  2023-12-08  8:57 ` Nikolaos Chatzikonstantinou
  2023-12-08 14:26 ` Luis Felipe
  0 siblings, 2 replies; 4+ messages in thread
From: Nikolaos Chatzikonstantinou @ 2023-12-08  6:59 UTC (permalink / raw)
  To: guile-user

Hello guile-user list,

I am trying to figure out modules and unit tests on Guile.

I would like to have a main.scm that prints a variable defined in
lib.scm and has unit tests in test.scm.

What I thought I had to do was to use

    (add-to-load-path (dirname (current-filename)))

This seemed to be the suggestion in 6.16.8 Load Paths of the Guile
manual. My entire main.scm looks like this:

    (define-module (applejack main))
    (add-to-load-path (dirname (current-filename)))
    (use-modules (applejack lib))
    (define-public (main)
      (format #t "Hello from ~a!~%" name))

My lib.scm is:

    (define-module (applejack))
    (define-public name "Applejack")

but I get an error, which I believe originates from current-filename
returning #f. Separately, the test suite in test.scm is just the
example in SRFI-64, but I don't know how to run it. I am using Emacs
and geiser-mode. If I run geiser-eval-buffer, I get test output, and
it promises that there is some more in vec-test.log, but the logfile
stands empty.

I would appreciate it if some pointers for the workflow of a small
Guile project along the lines above were given.

Regards,
Nikolaos Chatzikonstantinou



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-08 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08  6:59 Help with modules and unit tests Nikolaos Chatzikonstantinou
2023-12-08  8:57 ` Nikolaos Chatzikonstantinou
2023-12-08 14:26 ` Luis Felipe
2023-12-08 14:29   ` Luis Felipe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).