Guile examples consistency changes

Use new guile_embedded_run target or guile_run target for running the
examples like the other target languages (for suppressing stdout if run
from top level).

Consistency with other target language file renames: use runme.scm for
scripts and example.i, example.c for example code.

Add class example to examples being tested.
This commit is contained in:
William S Fulton 2013-05-09 08:21:02 +01:00
commit d974e9aced
21 changed files with 27 additions and 47 deletions

View file

@ -1,10 +1,11 @@
SRCS = matrix.c vector.c
TARGET = matrix
IFILE = package.i
IFILE = example.i
MKDIR = ..
TOP = ../..
check: build
./$(TARGET) -e do-test -s matrix.scm
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' GUILE_RUNOPTIONS='-e do-test' guile_embedded_run
build:
$(MAKE) -f $(MKDIR)/Makefile \

View file

@ -1,13 +1,13 @@
Matrix example. To run the example, execute the program 'matrix' and
type the following :
(load "matrix.scm")
(load "runme.scm")
(do-test 0)
Alternatively, use the command-line:
./matrix -e do-test -s matrix.scm
./matrix -e do-test -s runme.scm
Or, if your operating system is spiffy enough:
./matrix.scm
./runme.scm

View file

@ -1,7 +1,4 @@
// FILE : package.i
// See the SWIG users manual
/*** Matrix and vector package ***/
/*** Matrix and vector example ***/
%module Matrix
%{

View file

@ -1,24 +0,0 @@
#include <tcl.h>
extern int matrix_init(Tcl_Interp *); /* Init function from matrix.i */
int main() {
int code;
char input[1024];
Tcl_Interp *interp;
interp = Tcl_CreateInterp();
/* Initialize the wrappers */
if (matrix_init(interp) == TCL_ERROR)
exit(0);
fprintf(stdout,"matrix > ");
while(fgets(input, 1024, stdin) != NULL) {
code = Tcl_Eval(interp, input);
fprintf(stdout,"%s\n",interp->result);
fprintf(stdout,"matrix > ");
}
}

View file

@ -211,4 +211,3 @@
(cleanup M-list))
;;; matrix.scm ends here