make tests standalone executable.

* tests/closure.test: Add shebang and boot-0 include.
* tests/let-syntax.test: Likewise.
* tests/let.test: Likewise.
* tests/match.test: Likewise.
* tests/quasiquote.test: Likewise.
* tests/record.test: Likewise.
* tests/scm.test: Likewise.
* GNUmakefile (mes-check): Run tests by exec'ing.
This commit is contained in:
Jan Nieuwenhuizen 2016-10-16 17:34:51 +02:00
parent 219a8cdfbb
commit d18e50a569
9 changed files with 68 additions and 7 deletions

View file

@ -69,13 +69,11 @@ MES-0:=guile/mes-0.scm
MES:=./mes MES:=./mes
mes-check: all mes-check: all
for i in $(TESTS); do\ for i in $(TESTS); do ./$$i; done
cat $(BASE-0) $$(scripts/include.mes $$i) $$i | $(MES);\
done
guile-check: guile-check:
for i in $(TESTS); do\ for i in $(TESTS); do\
guile -s <(cat $(MES-0) $$(scripts/include.mes $$i | grep -Ev 'let.mes|quasiquote.mes|srfi-0') $$i);\ guile -s <(cat $(MES-0) $$(scripts/include.mes $$i | grep -Ev 'let.mes|quasiquote.mes|base-0|srfi-0') $$i);\
done done
for i in $(TESTS); do\ for i in $(TESTS); do\
guile -s <(cat $(MES-0) module/mes/test.mes $$i);\ guile -s <(cat $(MES-0) module/mes/test.mes $$i);\

8
tests/base.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes test)) (mes-use-module (mes test))

8
tests/closure.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes test)) (mes-use-module (mes test))

8
tests/let-syntax.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes quasiquote)) (mes-use-module (mes quasiquote))
(mes-use-module (mes let)) (mes-use-module (mes let))

8
tests/let.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes quasiquote)) (mes-use-module (mes quasiquote))
(mes-use-module (mes let)) (mes-use-module (mes let))

8
tests/match.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes quasiquote)) (mes-use-module (mes quasiquote))
(mes-use-module (mes let)) (mes-use-module (mes let))

8
tests/quasiquote.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes quasiquote)) (mes-use-module (mes quasiquote))
(mes-use-module (mes test)) (mes-use-module (mes test))

9
tests/record.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes quasiquote)) (mes-use-module (mes quasiquote))
(mes-use-module (mes let)) (mes-use-module (mes let))
@ -27,6 +35,7 @@
(mes-use-module (mes record-0)) (mes-use-module (mes record-0))
(mes-use-module (mes record)) (mes-use-module (mes record))
(mes-use-module (srfi srfi-9)) (mes-use-module (srfi srfi-9))
(mes-use-module (mes test)) (mes-use-module (mes test))
(when guile? (when guile?

12
tests/scm.test Normal file → Executable file
View file

@ -1,3 +1,10 @@
#! /bin/sh
# -*-scheme-*-
echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
#paredit:||
exit $?
!#
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
@ -18,6 +25,7 @@
;;; You should have received a copy of the GNU General Public License ;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>. ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
(mes-use-module (mes base-0))
(mes-use-module (mes base)) (mes-use-module (mes base))
(mes-use-module (mes quasiquote)) (mes-use-module (mes quasiquote))
(mes-use-module (mes let)) (mes-use-module (mes let))
@ -26,9 +34,7 @@
(mes-use-module (mes test)) (mes-use-module (mes test))
(when guile? (when guile?
(module-define! (current-module) 'builtin? (lambda (. x) #t)) (use-modules (srfi srfi-1)))
(use-modules (srfi srfi-1))
)
(pass-if "first dummy" #t) (pass-if "first dummy" #t)
(pass-if-not "second dummy" #f) (pass-if-not "second dummy" #f)