From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nikolaos Chatzikonstantinou Newsgroups: gmane.lisp.guile.user Subject: Help with modules and unit tests Date: Fri, 8 Dec 2023 01:59:20 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33639"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Dec 08 15:15:54 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rBbdy-0008cs-DO for guile-user@m.gmane-mx.org; Fri, 08 Dec 2023 15:15:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBbdV-00057h-GO; Fri, 08 Dec 2023 09:15:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBUpi-0004Vy-RP for guile-user@gnu.org; Fri, 08 Dec 2023 01:59:34 -0500 Original-Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBUph-0001LY-2x for guile-user@gnu.org; Fri, 08 Dec 2023 01:59:34 -0500 Original-Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-daf26d84100so1902144276.3 for ; Thu, 07 Dec 2023 22:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702018771; x=1702623571; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ENnCBwwbqRWkhCuAnzn2vTfsYaPe/kaTPss/GXWsZS0=; b=Ig8qaQr0yRqlNL7IiS+e6JeLojyzDagZB9wsa1qZk094GVNYkXF/ZhA3gv3OeaMqBl vbcotLhCFeKNbZQdbgG1a+XwsjyIKTAoh7HVy2cVewYOqLnB7cuZ2ZMKLnQ+kVQxesM5 zQONZWoyJYY7uHbSoNl6qYXso3nvG8WKXkfogQ7R0n/NJ6ofQBFmrMz5cP5r5iTOGkCh I3Sz6dbfsuxoowBYHmqf1ouNcHmfQabEvNJgtcDY2KvTY05uTmjzesP7aLyB5KQMO+UU UGyVSAwwsGORhSq9EnanJqhaVxUw7qJ7kKGx+E709OJUV3yY8XUvEFzB44jyq7nMscZD WFzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702018771; x=1702623571; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ENnCBwwbqRWkhCuAnzn2vTfsYaPe/kaTPss/GXWsZS0=; b=wRNQUrnaWFdnPFl83q8BvGAQLUTx8L98un/tPoLt5bvsviYmgdNXr5iXEnfROl6qku TqJ7geACUzTuzfbm58sT9XtwWPahlVVNhZKraaKOhKh3CN2Ap93G67TaOrxjsLZRKOCr /WTn8gh0L9eSSU9VOlBuw5Zfh7UeLstyBh1mJEgKPhIJhrk5GAN2a0A2Ro69QrlT+k2b BtDrpPg7ia9YSQ7iepytidrvW0ZRJoL6Mgud31FWrzVuCVS3fQrOAyUhcdc4QkQmz7Cd 6V5ErsGKyHjCrLKUI2/cWB9x1DLan4Mp3jdxm0uWve7NCZe/zAHQvmzobnPtj7eQuuED hBRg== X-Gm-Message-State: AOJu0Yy9DP6mrqq6EQIXo83nWjxcuRzF+fk1PTVVbK0OWVdI7YWzwznS Erd5jeeJ2L64lv9LPjkrZjlcRqEBT3HmiSz7FPQPsAjqtaazDQ== X-Google-Smtp-Source: AGHT+IEhz5exG3mZxXvOC+6yORUbDUOau20kZv2BnWEPVmFII4/Vv6rKgh+xTonWZRBSEZZC3cmNs8uvs0mHf9v69Uc= X-Received: by 2002:a25:952:0:b0:db7:dacf:59e4 with SMTP id u18-20020a250952000000b00db7dacf59e4mr3597883ybm.88.1702018771442; Thu, 07 Dec 2023 22:59:31 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::b29; envelope-from=nchatz314@gmail.com; helo=mail-yb1-xb29.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 08 Dec 2023 09:15:20 -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19361 Archived-At: 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