* 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
* Re: Help with modules and unit tests
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
1 sibling, 0 replies; 4+ messages in thread
From: Nikolaos Chatzikonstantinou @ 2023-12-08 8:57 UTC (permalink / raw)
To: guile-user
On Fri, Dec 8, 2023 at 1:59 AM Nikolaos Chatzikonstantinou
<nchatz314@gmail.com> wrote:
>
> Hello guile-user list,
>
> I am trying to figure out modules and unit tests on Guile.
Although I still appreciate the responses I may get, to save you all
some keystrokes, I found guile-dns to be a decent (and small) project
that shows off all the relevant bits I was curious about.
<https://git.lysator.liu.se/hugo/guile-dns>. However, I am still
wondering, how is documentation extracted from the source code with
guild doc-snarf?
Regards,
Nikolaos Chatzikonstantinou
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Help with modules and unit tests
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
1 sibling, 1 reply; 4+ messages in thread
From: Luis Felipe @ 2023-12-08 14:26 UTC (permalink / raw)
To: Nikolaos Chatzikonstantinou, guile-user
[-- Attachment #1.1.1: Type: text/plain, Size: 1424 bytes --]
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 #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2881 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Help with modules and unit tests
2023-12-08 14:26 ` Luis Felipe
@ 2023-12-08 14:29 ` Luis Felipe
0 siblings, 0 replies; 4+ messages in thread
From: Luis Felipe @ 2023-12-08 14:29 UTC (permalink / raw)
To: Nikolaos Chatzikonstantinou, guile-user
[-- Attachment #1.1.1: Type: text/plain, Size: 1678 bytes --]
El 8/12/23 a las 14:26, Luis Felipe escribió:
> 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/
For documentation extraction: https://luis-felipe.gitlab.io/guile-documenta/
(I sent the message incomplete by accident)
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2881 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ 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).