Make guile test suite default to scm api

In other words guilescm becomes guile.
Deprecated gh api tests are moved to guilegh.
This commit is contained in:
Geert Janssens 2013-03-07 14:39:38 +01:00
commit 7dfe4a0653
7 changed files with 27 additions and 41 deletions

View file

@ -2,14 +2,16 @@
# Makefile for guile test-suite
#######################################################################
EXTRA_TEST_CASES += guile_ext_test.externaltest
LANGUAGE = guile
VARIANT = _gh
VARIANT =
SCRIPTSUFFIX = _runme.scm
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
GUILE = @GUILE@
GUILE_RUNTIME=-runtime
GUILE_RUNTIME=
C_TEST_CASES = long_long \
list_vector \
@ -20,7 +22,7 @@ C_TEST_CASES = long_long \
include $(srcdir)/../common.mk
# Overridden variables here
# none!
INCLUDES += -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/guile
# Custom tests - tests with additional commandline options
%.multicpptest: SWIGOPT += $(GUILE_RUNTIME)
@ -41,6 +43,11 @@ include $(srcdir)/../common.mk
+$(swig_and_compile_multi_cpp)
$(run_testcase)
%.externaltest:
$(setup)
+$(swig_and_compile_external)
$(run_testcase)
# Runs the testcase. A testcase is only run if
# a file is found which has _runme.scm appended after the testcase name.
run_testcase = \

View file

@ -0,0 +1,24 @@
#include <guile_ext_test_wrap_hdr.h>
#include <imports_a.h>
SCM test_create()
{
#define FUNC_NAME "test-create"
SCM result;
A *newobj;
swig_type_info *type;
newobj = new A();
type = SWIG_TypeQuery("A *");
result = SWIG_NewPointerObj(newobj, type, 1);
return result;
#undef FUNC_NAME
}
SCM test_is_pointer(SCM val)
{
#define FUNC_NAME "test-is-pointer"
return SCM_BOOL(SWIG_IsPointer(val));
#undef FUNC_NAME
}

View file

@ -0,0 +1,19 @@
(dynamic-call "scm_init_guile_ext_test_module" (dynamic-link "./libguile_ext_test.so"))
; This is a test for SF Bug 1573892
; If IsPointer is called before TypeQuery, the test-is-pointer will fail
; (i.e if the bottom two lines were moved to the top, the old code would succeed)
; only a problem when is-pointer is called first
(define a (new-A))
(if (not (test-is-pointer a))
(error "test-is-pointer failed!"))
(if (test-is-pointer 5)
(error "test-is-pointer thinks 5 is a pointer!"))
(define b (test-create))
(A-hello b)
(exit 0)

View file

@ -0,0 +1,19 @@
%module guile_ext_test
/* just use the imports_a.h header... for this test we only need a class */
%{
#include "imports_a.h"
%}
%include "imports_a.h"
%{
SCM test_create();
SCM test_is_pointer(SCM val);
%}
%init %{
scm_c_define_gsubr("test-create", 0, 0, 0, (swig_guile_proc) test_create);
scm_c_define_gsubr("test-is-pointer", 1, 0, 0, (swig_guile_proc) test_is_pointer);
%}

View file

@ -0,0 +1,28 @@
#######################################################################
# Makefile for guile test-suite (with SCM API)
#######################################################################
include ../guile/Makefile
# Overridden variables here
VARIANT = _gh
# Refer to the guile directory for the run scripts
SCRIPTPREFIX = ../guile/
GUILE_RUNTIME=-runtime
# Custom tests - tests with additional commandline options
# none!
# Runs the testcase. A testcase is only run if
# a file is found which has _runme.scm appended after the testcase name.
run_testcase = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(GUILE) -l $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
fi
setup = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE) (with GH API)" ; \
else \
echo "$(ACTION)ing testcase $* under $(LANGUAGE) (with GH API)" ; \
fi

View file

@ -59,7 +59,7 @@ skip-tcl = test -n "@SKIP_TCL@"
skip-perl5 = test -n "@SKIP_PERL5@"
skip-python = test -n "@SKIP_PYTHON@"
skip-java = test -n "@SKIP_JAVA@"
skip-guilescm = test -n "@SKIP_GUILESCM@"
skip-guilegh = test -n "@SKIP_GUILEGH@"
skip-guile = test -n "@SKIP_GUILE@"
skip-mzscheme = test -n "@SKIP_MZSCHEME@"
skip-ruby = test -n "@SKIP_RUBY@"
@ -247,7 +247,7 @@ check-test-suite: \
check-perl5-test-suite \
check-python-test-suite \
check-java-test-suite \
check-guilescm-test-suite \
check-guilegh-test-suite \
check-guile-test-suite \
check-mzscheme-test-suite \
check-ruby-test-suite \
@ -300,7 +300,7 @@ all-test-suite: \
all-perl5-test-suite \
all-python-test-suite \
all-java-test-suite \
all-guilescm-test-suite \
all-guilegh-test-suite \
all-guile-test-suite \
all-mzscheme-test-suite \
all-ruby-test-suite \
@ -329,7 +329,7 @@ broken-test-suite: \
broken-perl5-test-suite \
broken-python-test-suite \
broken-java-test-suite \
broken-guilescm-test-suite \
broken-guilegh-test-suite \
broken-guile-test-suite \
broken-mzscheme-test-suite \
broken-ruby-test-suite \

View file

@ -2268,16 +2268,16 @@ AC_SUBST(SKIP_JAVA)
SKIP_GUILE=
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_GH_INTERFACE"; then
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_SCM_INTERFACE"; then
SKIP_GUILE="1"
fi
AC_SUBST(SKIP_GUILE)
SKIP_GUILESCM=
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_SCM_INTERFACE"; then
SKIP_GUILESCM="1"
SKIP_GUILEGH=
if test -z "$GUILEINCLUDE" || test -z "$GUILELIB" || test -z "$GUILE_GH_INTERFACE"; then
SKIP_GUILEGH="1"
fi
AC_SUBST(SKIP_GUILESCM)
AC_SUBST(SKIP_GUILEGH)
SKIP_MZSCHEME=
@ -2454,7 +2454,7 @@ AC_CONFIG_FILES([ \
Examples/test-suite/csharp/Makefile \
Examples/test-suite/d/Makefile \
Examples/test-suite/guile/Makefile \
Examples/test-suite/guilescm/Makefile \
Examples/test-suite/guilegh/Makefile \
Examples/test-suite/java/Makefile \
Examples/test-suite/mzscheme/Makefile \
Examples/test-suite/ocaml/Makefile \