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.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-12-30 11:22:28 +01:00
parent 4dcff51a38
commit d7b6f777dd
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
3 changed files with 75 additions and 6 deletions

29
tests/data/bar.scm Normal file
View File

@ -0,0 +1,29 @@
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; bar.scm is used by tests/module.test
;;; Code:
(pke "hello bar!!!")
(define-module (tests data bar)
#:export (bar))
(define bar "bar")

30
tests/data/foo.scm Normal file
View File

@ -0,0 +1,30 @@
;;; GNU Mes --- Maxwell Equations of Software
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; foo.scm is used by tests/module.test
;;; Code:
(pke "hello foo!!!")
(define-module (tests data foo)
#:export (foo))
(define foo "foo")

View File

@ -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)