diff --git a/.gitignore b/.gitignore index e3d40957..37a55e4a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ *.gcc-stdout *.go *.guile +*.guile-log *.log *.mes-gcc *.mes-gcc-o diff --git a/build-aux/check-mes.sh b/build-aux/check-mes.sh new file mode 100755 index 00000000..94f7c8eb --- /dev/null +++ b/build-aux/check-mes.sh @@ -0,0 +1,91 @@ +#! /bin/sh + +# Mes --- Maxwell Equations of Software +# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen +# +# This file is part of Mes. +# +# 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. +# +# 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 Mes. If not, see . + +export BASH +export GUILE MES MES_ARENA +export BUILD_DEBUG + +if [ "$MES" = guile ]; then + mes=guile- +fi +BASH=${BASH-bash} +GUILE=${GUILE-guile} +MES=${MES-src/mes} +MES_ARENA=${MES_ARENA-100000000} + +set -e + +tests=" +tests/boot.test +tests/read.test +tests/base.test +tests/quasiquote.test +tests/let.test +tests/closure.test +tests/scm.test +tests/display.test +tests/cwv.test +tests/math.test +tests/vector.test +tests/srfi-1.test +tests/srfi-9.test +tests/srfi-13.test +tests/srfi-14.test +tests/srfi-43.test +tests/optargs.test +tests/fluids.test +tests/catch.test +tests/getopt-long.test +tests/guile.test +tests/syntax.test +tests/let-syntax.test +tests/pmatch.test +tests/match.test +tests/psyntax.test +" + +slow_or_broken=" +tests/peg.test +" + +set +e +fail=0 +total=0 +for t in $tests; do + if [ ! -f $t ]; then + echo $t: [SKIP]; + continue + fi + sh "$t" &> $t.${mes}log + r=$? + total=$((total+1)) + if [ $r = 0 ]; then + echo $t: [${mes}OK] + else + echo $t: [${mes}FAIL] + fail=$((fail+1)) + fi +done +if [ $fail != 0 ]; then + echo FAILED: $fail/$total + exit 1 +else + echo PASS: $total +fi diff --git a/check.sh b/check.sh index 8407dd51..75f6d5fd 100755 --- a/check.sh +++ b/check.sh @@ -18,83 +18,21 @@ # You should have received a copy of the GNU General Public License # along with Mes. If not, see . -export BASH export CC32 export GUILE MES MES_ARENA export BUILD_DEBUG -BASH=${BASH-bash} -CC32=${CC32-$(command -v i686-unknown-linux-gnu-gcc)} GUILE=${GUILE-guile} MES=${MES-src/mes} MES_ARENA=${MES_ARENA-100000000} -prefix= if ! command -v $GUILE > /dev/null; then GUILE=true fi set -e + +[ "$GUILE" != true ] && MES=guile bash build-aux/check-mes.sh +bash build-aux/check-mes.sh bash build-aux/check-boot.sh - -tests=" -tests/boot.test -tests/read.test -tests/base.test -tests/quasiquote.test -tests/let.test -tests/closure.test -tests/scm.test -tests/display.test -tests/cwv.test -tests/math.test -tests/vector.test -tests/srfi-1.test -tests/srfi-9.test -tests/srfi-13.test -tests/srfi-14.test -tests/srfi-43.test -tests/optargs.test -tests/fluids.test -tests/catch.test -tests/getopt-long.test -tests/guile.test -tests/syntax.test -tests/let-syntax.test -tests/pmatch.test -tests/match.test -tests/psyntax.test -" - -slow_or_broken=" -tests/peg.test -" - -tests=$(for t in $tests; do echo $t-guile; echo $t; done) - -set +e -fail=0 -total=0 -for t in $tests; do - if [ ! -f $t ]; then - echo $t: [SKIP]; - continue - fi - sh "$t" &> $t.log - r=$? - total=$((total+1)) - if [ $r = 0 ]; then - echo $t: [OK] - else - echo $t: [FAIL] - fail=$((fail+1)) - fi -done -if [ $fail != 0 ]; then - echo FAILED: $fail/$total - exit 1 -else - echo PASS: $total -fi - -$BASH build-aux/check-mescc.sh +bash build-aux/check-mescc.sh diff --git a/mes/module/mes/boot-0.scm b/mes/module/mes/boot-0.scm index bac5b6a8..a27566e4 100644 --- a/mes/module/mes/boot-0.scm +++ b/mes/module/mes/boot-0.scm @@ -244,7 +244,8 @@ (let ((tty? (isatty? 0))) (define (parse-opts args) (let* ((option-spec - '((compiled-path (single-char #\C) (value #t)) + '((no-auto-compile) + (compiled-path (single-char #\C) (value #t)) (dump) (help (single-char #\h)) (load) @@ -279,14 +280,18 @@ Evaluate code with Mes, interactively or from a script. The above switches stop argument processing, and pass all remaining arguments as the value of (command-line). - -C,--compiled-path=DIR - ignored for Guile compatibility --dump dump binary program to stdout -e,--main=MAIN after reading script, apply MAIN to command-line arguments -h, --help display this help and exit --load load binary program [module/mes/boot-0.32-mo] -L,--load-path=DIR add DIR to the front of the module load path -v, --version display version information and exit + +Ignored for Guile compatibility: + --auto-compile + --fresh-auto-compile + --no-auto-compile + -C,--compiled-path=DIR " (or (and usage? (current-error-port)) (current-output-port))) (exit (or (and usage? 2) 0))) options) diff --git a/module/mes/mes-0.scm b/module/mes/mes-0.scm index 99a0327d..773c0a17 100644 --- a/module/mes/mes-0.scm +++ b/module/mes/mes-0.scm @@ -25,7 +25,23 @@ ;;; Code: +(define-module (mes mes-0) + #:export ( + builtin? + mes-use-module + EOF + append2 + mes? + guile? + guile-1.8? + guile-2? + )) + (define-macro (mes-use-module . rest) #t) (define builtin? procedure?) ; not strictly true, but ok for tests/*.test +(define mes? #f) +(define guile? #t) +(define guile-1.8? (equal? (effective-version) "1.8")) +(define guile-2? (equal? (major-version) "2")) (define EOF (if #f #f)) (define append2 append) diff --git a/module/mes/test.scm b/module/mes/test.scm index 508e4098..00fe9617 100644 --- a/module/mes/test.scm +++ b/module/mes/test.scm @@ -25,6 +25,17 @@ ;;; Code: +(define-module (mes test) + #:export ( + pass-if + pass-if-equal + pass-if-not + pass-if-eq + result + seq? ; deprecated + sequal? ; deprecated + )) + (cond-expand (mes (define mes? #t) diff --git a/tests/base.test b/tests/base.test index e9942df9..59e87f34 100755 --- a/tests/base.test +++ b/tests/base.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests base)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests base) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes test)) (pass-if "first dummy" #t) diff --git a/tests/base.test-guile b/tests/base.test-guile deleted file mode 100755 index 8944d1de..00000000 --- a/tests/base.test-guile +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh - -# Mes --- Maxwell Equations of Software -# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen -# -# This file is part of Mes. -# -# 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. -# -# 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 Mes. If not, see . - -test=$(dirname $0)/$(basename $0 -guile) -GUILE=${GUILE-guile} -cat module/mes/mes-0.scm module/mes/test.scm $test | exec $GUILE --no-auto-compile -L module-guile -C module-guile -L module -C module -s /dev/stdin diff --git a/tests/boot.test b/tests/boot.test index 86b58354..69eee62e 100755 --- a/tests/boot.test +++ b/tests/boot.test @@ -1,9 +1,12 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -export MES_BOOT=boot-02.scm -$MES < $0 -exit $? +if [ "$MES" != guile ]; then + export MES_BOOT=boot-02.scm + MES=${MES-$(dirname $0)/../src/mes} + $MES < $0 + exit $? +fi +exec ${MES-mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests boot)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -26,8 +29,16 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . -(begin +(define-module (tests boot) + #:use-module (mes mes-0) + #:use-module (mes test)) + +(cond-expand + (mes (primitive-load "module/mes/test.scm")) + (guile-2) + (guile + (use-modules (ice-9 syncase)))) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) diff --git a/tests/boot.test-guile b/tests/boot.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/boot.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/catch.test b/tests/catch.test index 62ee9e50..22491b5b 100755 --- a/tests/catch.test +++ b/tests/catch.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests catch)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests base) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes catch)) (mes-use-module (mes test)) @@ -67,4 +69,3 @@ exit $? 22))))) (result 'report) - diff --git a/tests/catch.test-guile b/tests/catch.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/catch.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/closure.test b/tests/closure.test index ea1acdb1..c1659a65 100755 --- a/tests/closure.test +++ b/tests/closure.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests closure)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests closure) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes test)) (pass-if "first dummy" #t) diff --git a/tests/closure.test-guile b/tests/closure.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/closure.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/cwv.test b/tests/cwv.test index 97135799..3c7a6baa 100755 --- a/tests/cwv.test +++ b/tests/cwv.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests cwv)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests cwv) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes scm)) (mes-use-module (mes test)) diff --git a/tests/cwv.test-guile b/tests/cwv.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/cwv.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/display.test b/tests/display.test index 88d49647..0e5a046f 100755 --- a/tests/display.test +++ b/tests/display.test @@ -1,14 +1,11 @@ #! /bin/sh -# -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests display)' -s "$0" "$@" !# ;;; -*-scheme-*- ;;; Mes --- Maxwell Equations of Software -;;; Copyright © 2016 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2016,2018 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of Mes. ;;; @@ -25,6 +22,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests display) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes display)) (mes-use-module (mes test)) diff --git a/tests/display.test-guile b/tests/display.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/display.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/fluids.test b/tests/fluids.test index 3f22eff0..9e8b7e08 100755 --- a/tests/fluids.test +++ b/tests/fluids.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests fluids)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests fluids) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes fluids)) (mes-use-module (mes test)) diff --git a/tests/fluids.test-guile b/tests/fluids.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/fluids.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/getopt-long.test b/tests/getopt-long.test index 237afa23..e52d97a8 100755 --- a/tests/getopt-long.test +++ b/tests/getopt-long.test @@ -1,8 +1,5 @@ #! /bin/sh -# -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests getopt-long)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,12 +22,16 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests getopt-long) + #:use-module (mes mes-0) + #:use-module (mes test) + #:use-module (mes getopt-long)) + (cond-expand - (guile - (use-modules (mes getopt-long))) (mes (mes-use-module (mes getopt-long)) - (mes-use-module (mes test)))) + (mes-use-module (mes test))) + (else)) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) diff --git a/tests/getopt-long.test-guile b/tests/getopt-long.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/getopt-long.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/guile.test b/tests/guile.test index 2939a244..ad584766 100755 --- a/tests/guile.test +++ b/tests/guile.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests guile)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,15 +23,16 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . -;;(if guile? (exit 0)) +(define-module (tests guile) + #:use-module (ice-9 rdelim) + #:use-module (mes mes-0) + #:use-module (mes test)) (cond-expand - ;;(guile-2) - (guile - (use-modules (ice-9 rdelim))) (mes (mes-use-module (mes test)) - (mes-use-module (mes guile)))) + (mes-use-module (mes guile))) + (else)) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) diff --git a/tests/guile.test-guile b/tests/guile.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/guile.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/let-syntax.test b/tests/let-syntax.test index 0df7b211..1b102578 100755 --- a/tests/let-syntax.test +++ b/tests/let-syntax.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests let-syntax)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests let-syntax) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes syntax)) (mes-use-module (mes test)) diff --git a/tests/let-syntax.test-guile b/tests/let-syntax.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/let-syntax.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/let.test b/tests/let.test index 24483ebb..372ee7b4 100755 --- a/tests/let.test +++ b/tests/let.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests let)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests let) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes let)) (mes-use-module (mes test)) diff --git a/tests/let.test-guile b/tests/let.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/let.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/match.test b/tests/match.test index 1be8e5bd..c05ff353 100755 --- a/tests/match.test +++ b/tests/match.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests match)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests match) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes match)) (mes-use-module (mes test)) diff --git a/tests/match.test-guile b/tests/match.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/match.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/math.test b/tests/math.test index 2be1e448..6a09cfbd 100755 --- a/tests/math.test +++ b/tests/math.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests math)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests math) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes test)) (pass-if-equal "string->number" 42 (string->number "42")) (pass-if-equal "string->number neg" -42 (string->number "-42")) diff --git a/tests/math.test-guile b/tests/math.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/math.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/module.test b/tests/module.test index 643645a0..35fd219e 100755 --- a/tests/module.test +++ b/tests/module.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests module)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests module) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes test)) (pass-if "first dummy" #t) diff --git a/tests/module.test-guile b/tests/module.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/module.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/optargs.test b/tests/optargs.test index 63b82f6e..05263a21 100755 --- a/tests/optargs.test +++ b/tests/optargs.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests optargs)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,12 +23,16 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests optargs) + #:use-module (ice-9 optargs) + #:use-module (mes mes-0) + #:use-module (mes test)) + (cond-expand - (guile - (use-modules (ice-9 optargs))) (mes (mes-use-module (mes optargs)) - (mes-use-module (mes test)))) + (mes-use-module (mes test))) + (else)) (pass-if-equal "cond =>" 10 (cond diff --git a/tests/optargs.test-guile b/tests/optargs.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/optargs.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/peg.test b/tests/peg.test index f6d40aac..ee180c0b 100755 --- a/tests/peg.test +++ b/tests/peg.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests peg)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,17 +23,20 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests peg) + #:use-module (mes mes-0) + #:use-module (mes test)) (cond-expand + (mes + (mes-use-module (mes peg)) + (mes-use-module (mes test))) (guile-2.2 (use-modules (ice-9 peg))) (guile (use-modules (ice-9 syncase)) (display "guile 2.0: no PEG\n" (current-error-port)) - (exit 0)) - (mes - (mes-use-module (mes peg)) - (mes-use-module (mes test)))) + (exit 0))) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) @@ -56,7 +57,7 @@ NL < '\n'") (pass-if-equal "peg-tree" (map (lambda (x) (list 'entry x)) (string-split *etc-passwd* #\newline)) (peg:tree (match-pattern string-passwd *etc-passwd*))) - + (define-peg-pattern passwd body (and (* entry) (not-followed-by peg-any))) (define-peg-pattern entry all (and (* (and (not-followed-by NL) peg-any)) (* NL))) diff --git a/tests/peg.test-guile b/tests/peg.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/peg.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/pmatch.test b/tests/pmatch.test index 0c913fc2..9779955c 100755 --- a/tests/pmatch.test +++ b/tests/pmatch.test @@ -1,14 +1,12 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests pmatch)' -s "$0" "$@" !# ;;; -*-scheme-*- ;;; Mes --- Maxwell Equations of Software -;;; Copyright © 2017 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of Mes. ;;; @@ -25,16 +23,16 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests pmatch) + #:use-module (system base pmatch) + #:use-module (mes mes-0) + #:use-module (mes test)) + (cond-expand - (guile - (use-modules (system base pmatch)) - ;;(include-from-path "mes/pmatch.scm") - ;;(include-from-path "mes-0.scm") - ;;(include-from-path "mes/test.mes") - ) (mes (mes-use-module (mes test)) - (mes-use-module (mes pmatch)))) + (mes-use-module (mes pmatch))) + (else)) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) diff --git a/tests/pmatch.test-guile b/tests/pmatch.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/pmatch.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/psyntax.test b/tests/psyntax.test index 64d9cc7e..966a0fb1 100755 --- a/tests/psyntax.test +++ b/tests/psyntax.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests psyntax)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,7 +23,14 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests psyntax) + #:use-module (mes mes-0) + #:use-module (mes test)) + (cond-expand + (mes + (mes-use-module (mes psyntax)) + (mes-use-module (mes test))) (guile-2.2 (define sc-expand identity) (define syntax-object->datum syntax->datum) @@ -37,10 +42,7 @@ exit $? (define-macro (with-ellipsis . stuff) #t)) (guile (use-modules (ice-9 syncase)) - (define sc-expand identity)) - (mes - (mes-use-module (mes psyntax)) - (mes-use-module (mes test)))) + (define sc-expand identity))) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) diff --git a/tests/psyntax.test-guile b/tests/psyntax.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/psyntax.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/quasiquote.test b/tests/quasiquote.test index 042ea5ac..a275dedc 100755 --- a/tests/quasiquote.test +++ b/tests/quasiquote.test @@ -1,9 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -#paredit:|| -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests quasiquote)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -26,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests quasiquote) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes base)) (mes-use-module (mes quasiquote)) (mes-use-module (mes test)) diff --git a/tests/quasiquote.test-guile b/tests/quasiquote.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/quasiquote.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/read.test b/tests/read.test index 1b470f8a..977c4f1f 100755 --- a/tests/read.test +++ b/tests/read.test @@ -2,8 +2,7 @@ # -*-scheme-*- # ***REMOVE THIS BLOCK COMMENT INITIALLY*** MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec $MES -s $0 !# 0 diff --git a/tests/read.test-guile b/tests/read.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/read.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/scm.test b/tests/scm.test index 98055a9f..d6f3c16f 100755 --- a/tests/scm.test +++ b/tests/scm.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests scm)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests scm) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes scm)) (mes-use-module (srfi srfi-0)) (mes-use-module (mes test)) diff --git a/tests/scm.test-guile b/tests/scm.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/scm.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/srfi-1.test b/tests/srfi-1.test index c5fd1443..75ff7f79 100755 --- a/tests/srfi-1.test +++ b/tests/srfi-1.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-1)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,7 +23,11 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . -(cond-expand (guile (use-modules (srfi srfi-1))) (mes)) +(define-module (tests srfi-1) + #:use-module (srfi srfi-1) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (srfi srfi-1)) (mes-use-module (mes test)) diff --git a/tests/srfi-1.test-guile b/tests/srfi-1.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/srfi-1.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/srfi-13.test b/tests/srfi-13.test index bad99a1b..527c0e17 100755 --- a/tests/srfi-13.test +++ b/tests/srfi-13.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-13)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests srfi-13) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (srfi srfi-13)) (mes-use-module (mes test)) diff --git a/tests/srfi-13.test-guile b/tests/srfi-13.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/srfi-13.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/srfi-14.test b/tests/srfi-14.test index c1be2d3f..165b40e2 100755 --- a/tests/srfi-14.test +++ b/tests/srfi-14.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-14)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,7 +23,11 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . -(cond-expand (guile (use-modules (srfi srfi-14))) (mes)) +(define-module (tests srfi-14) + #:use-module (srfi srfi-14) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (srfi srfi-14)) (mes-use-module (mes test)) @@ -48,4 +50,3 @@ exit $? (char-set= (char-set #\a #\b #\c #\d) (string->char-set! "d" (string->char-set "abc")))) (result 'report) - diff --git a/tests/srfi-14.test-guile b/tests/srfi-14.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/srfi-14.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/srfi-16.test b/tests/srfi-16.test index f124e67c..91656e9c 100755 --- a/tests/srfi-16.test +++ b/tests/srfi-16.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-16)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests srfi-16) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (srfi srfi-16)) (mes-use-module (mes test)) @@ -42,4 +44,3 @@ exit $? ((x) 1)) #f)) (result 'report) - diff --git a/tests/srfi-16.test-guile b/tests/srfi-16.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/srfi-16.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/srfi-43.test b/tests/srfi-43.test index 3fb6da8d..0e085d1e 100755 --- a/tests/srfi-43.test +++ b/tests/srfi-43.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-43)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,9 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . -(cond-expand - (mes) - (guile (use-modules (srfi srfi-43)))) +(define-module (tests srfi-43) + #:use-module (srfi srfi-43) + #:use-module (mes mes-0) + #:use-module (mes test)) (mes-use-module (srfi srfi-43)) (mes-use-module (mes test)) @@ -46,4 +45,3 @@ exit $? g)) (result 'report) - diff --git a/tests/srfi-43.test-guile b/tests/srfi-43.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/srfi-43.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/srfi-9.test b/tests/srfi-9.test index 9d32cbf7..73e3b934 100755 --- a/tests/srfi-9.test +++ b/tests/srfi-9.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests srfi-9)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,15 +23,18 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests srfi-9) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-9 gnu) + #:use-module (mes mes-0) + #:use-module (mes test)) (cond-expand (mes (mes-use-module (srfi srfi-9)) (mes-use-module (srfi srfi-9 gnu)) (mes-use-module (mes test))) - (guile - (use-modules (srfi srfi-9)) - (use-modules (srfi srfi-9 gnu)))) + (else)) (pass-if "first dummy" #t) (pass-if-not "second dummy" #f) diff --git a/tests/srfi-9.test-guile b/tests/srfi-9.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/srfi-9.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/syntax.test b/tests/syntax.test index 115c76d5..4b9d9ec7 100755 --- a/tests/syntax.test +++ b/tests/syntax.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests syntax)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests syntax) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes test)) (mes-use-module (mes syntax)) diff --git a/tests/syntax.test-guile b/tests/syntax.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/syntax.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file diff --git a/tests/vector.test b/tests/vector.test index a63acc69..bd407fb1 100755 --- a/tests/vector.test +++ b/tests/vector.test @@ -1,8 +1,6 @@ #! /bin/sh # -*-scheme-*- -MES=${MES-$(dirname $0)/../src/mes} -$MES -s $0 -exit $? +exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests vector)' -s "$0" "$@" !# ;;; -*-scheme-*- @@ -25,6 +23,10 @@ exit $? ;;; You should have received a copy of the GNU General Public License ;;; along with Mes. If not, see . +(define-module (tests vector) + #:use-module (mes mes-0) + #:use-module (mes test)) + (mes-use-module (mes scm)) (mes-use-module (mes test)) diff --git a/tests/vector.test-guile b/tests/vector.test-guile deleted file mode 120000 index 5631f4a9..00000000 --- a/tests/vector.test-guile +++ /dev/null @@ -1 +0,0 @@ -base.test-guile \ No newline at end of file