- Fix SF bug 1573892
- Minor change to chicken to make it work with version 2.5rc1 - add externaltest to chicken and guile modules git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9451 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5149b7b4f3
commit
56904f30d0
13 changed files with 175 additions and 2 deletions
|
|
@ -20,6 +20,8 @@ SKIP_CPP_STD_CASES = Yes
|
|||
|
||||
CPP_TEST_CASES += li_std_string
|
||||
|
||||
EXTRA_TEST_CASES += ext_test.externaltest
|
||||
|
||||
include $(srcdir)/../common.mk
|
||||
|
||||
|
||||
|
|
@ -51,6 +53,11 @@ SWIGOPT += -nounit
|
|||
$(MAKE) $*.multiproxy; ) \
|
||||
fi;
|
||||
|
||||
%.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 = \
|
||||
|
|
|
|||
21
Examples/test-suite/chicken/ext_test.i
Normal file
21
Examples/test-suite/chicken/ext_test.i
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
%module 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"
|
||||
|
||||
%{
|
||||
void test_create(C_word,C_word,C_word) C_noret;
|
||||
%}
|
||||
|
||||
%init %{
|
||||
{
|
||||
C_word *space = C_alloc(2 + C_SIZEOF_INTERNED_SYMBOL(11));
|
||||
sym = C_intern (&space, 11, "test-create");
|
||||
C_mutate ((C_word*)sym+1, (*space=C_CLOSURE_TYPE|1, space[1]=(C_word)test_create, tmp=(C_word)space, space+=2, tmp));
|
||||
}
|
||||
%}
|
||||
|
||||
22
Examples/test-suite/chicken/ext_test_external.cxx
Normal file
22
Examples/test-suite/chicken/ext_test_external.cxx
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include <ext_test_wrap_hdr.h>
|
||||
#include <imports_a.h>
|
||||
|
||||
void test_create(C_word,C_word,C_word) C_noret;
|
||||
void test_create(C_word argc, C_word closure, C_word continuation) {
|
||||
C_word resultobj;
|
||||
swig_type_info *type;
|
||||
A *newobj;
|
||||
C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);
|
||||
|
||||
C_trace("test-create");
|
||||
if (argc!=2) C_bad_argc(argc,2);
|
||||
|
||||
|
||||
newobj = new A();
|
||||
|
||||
type = SWIG_TypeQuery("A *");
|
||||
resultobj = SWIG_NewPointerObj(newobj, type, 1);
|
||||
|
||||
C_kontinue(continuation, resultobj);
|
||||
}
|
||||
|
||||
5
Examples/test-suite/chicken/ext_test_runme.ss
Normal file
5
Examples/test-suite/chicken/ext_test_runme.ss
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(load "ext_test.so")
|
||||
|
||||
(define a (test-create))
|
||||
|
||||
(A-hello a)
|
||||
Loading…
Add table
Add a link
Reference in a new issue