From d7b6f777ddf5de5d413ff650ad808161938d6f59 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 30 Dec 2020 11:22:28 +0100 Subject: [PATCH] tests/module.mes: first pass! * tests/data/foo.scm, tests/data/bar.scm: New files. * tests/module.test (tests): Use them to test Guile module-lookup. --- tests/data/bar.scm | 29 +++++++++++++++++++++++++++++ tests/data/foo.scm | 30 ++++++++++++++++++++++++++++++ tests/module.test | 22 ++++++++++++++++------ 3 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 tests/data/bar.scm create mode 100644 tests/data/foo.scm diff --git a/tests/data/bar.scm b/tests/data/bar.scm new file mode 100644 index 00000000..e0030edc --- /dev/null +++ b/tests/data/bar.scm @@ -0,0 +1,29 @@ +;;; GNU Mes --- Maxwell Equations of Software +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; +;;; This file is part of GNU Mes. +;;; +;;; GNU Mes is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Mes is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Mes. If not, see . + +;;; Commentary: + +;;; bar.scm is used by tests/module.test + +;;; Code: + +(pke "hello bar!!!") +(define-module (tests data bar) + #:export (bar)) + +(define bar "bar") diff --git a/tests/data/foo.scm b/tests/data/foo.scm new file mode 100644 index 00000000..e1391c89 --- /dev/null +++ b/tests/data/foo.scm @@ -0,0 +1,30 @@ +;;; GNU Mes --- Maxwell Equations of Software +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; +;;; This file is part of GNU Mes. +;;; +;;; GNU Mes is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Mes is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Mes. If not, see . + +;;; Commentary: + +;;; foo.scm is used by tests/module.test + +;;; Code: + +(pke "hello foo!!!") + +(define-module (tests data foo) + #:export (foo)) + +(define foo "foo") diff --git a/tests/module.test b/tests/module.test index e13f927e..e0473c8b 100755 --- a/tests/module.test +++ b/tests/module.test @@ -1,6 +1,7 @@ #! /bin/sh # -*-scheme-*- -GUILE_LOAD_PATH=mes/module:module +srcdir=${srcdir-.} +GUILE_LOAD_PATH=mes/module:module:$srcdir export GUILE_LOAD_PATH MES_BOOT=boot-5.mes export MES_BOOT @@ -29,10 +30,19 @@ exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests (define-module (tests module) ;; #:use-module (mes mes-0) - ;; #:use-module (mes misc) - #:use-module (mes test)) + #:use-module (tests data foo) + #:use-module (tests data bar) + ;;#:use-module (mes test) + ) -(pass-if "first dummy" #t) -(pass-if-not "second dummy" #f) +(define (tests . rest) (format (current-error-port) "zis is tests: rest=~s\n" rest)) +(define (module) "zis is module") +(pke "hiero") +(format (current-error-port) "foo=~s\n" foo) +(format (current-error-port) "bar=~s\n" bar) -(result 'report) + +;; (pass-if "first dummy" #t) +;; (pass-if-not "second dummy" #f) + +;;(result 'report)