guile-user
[Top][All Lists]
Advanced

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

Re: Help with modules and unit tests


From: Luis Felipe
Subject: Re: Help with modules and unit tests
Date: Fri, 8 Dec 2023 14:26:15 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

Hi Nikolaos,

El 8/12/23 a las 6:59, Nikolaos Chatzikonstantinou escribió:
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.

Personally, I'm using these

For running tests: https://luis-felipe.gitlab.io/guile-proba/


Attachment: OpenPGP_0x0AB0D067012F08C3.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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