The great merge

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2002-11-30 22:01:28 +00:00
commit 516036631c
1508 changed files with 125983 additions and 44037 deletions

View file

@ -0,0 +1 @@
*wrap.c*

View file

@ -0,0 +1,40 @@
#######################################################################
# $Header$
# Makefile for mzscheme test-suite
#######################################################################
LANGUAGE = mzscheme
SCRIPTSUFFIX = _runme.scm
include ../common.mk
# Overridden variables here
# Rules for the different types of tests
%.cpptest:
$(setup) \
($(swig_and_compile_cpp); ); \
$(run_testcase)
%.ctest:
$(setup) \
($(swig_and_compile_c); ); \
$(run_testcase)
%.multicpptest:
$(setup) \
($(swig_and_compile_multi_cpp); ); \
$(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 = \
if [ -f $*\_runme.scm ]; then ( \
env LD_LIBRARY_PATH=$(DYNAMIC_LIB_PATH):$$LD_LIBRARY_PATH mzscheme -r $*\_runme.scm;) \
fi;
# Clean
%.clean:
clean:
$(MAKE) -f $(TOP)/Makefile mzscheme_clean

View file

@ -0,0 +1,4 @@
See ../README for common README file.
Any testcases which have _runme.scm appended after the testcase name will be detected and run.

View file

@ -0,0 +1,7 @@
(load-extension "casts.so")
(define x (new-B))
(A-hello x)
(exit 0)

View file

@ -0,0 +1,6 @@
(load-extension "char_constant.so")
(if (and (char? (CHAR-CONSTANT))
(string? (STRING-CONSTANT)))
(exit 0)
(exit 1))

View file

@ -0,0 +1,16 @@
;;; This file is part of a test for SF bug #231619.
;;; It shows that the %import directive does not work properly in SWIG
;;; 1.3a5: Type information is not properly generated if a base class
;;; comes from an %import-ed file.
(load-extension "libimports_a.so")
(load-extension "libimports_b.so")
(define x (new-B))
;; This fails in 1.3a5 because the SWIG runtime code does not know
;; that x (an instance of class B) can be passed to methods of class A.
(A-hello x)
(exit 0)

View file

@ -0,0 +1,10 @@
;; The SWIG modules have "passive" Linkage, i.e., they don't generate
;; Guile modules (namespaces) but simply put all the bindings into the
;; current module. That's enough for such a simple test.
(load-extension "./name.so")
(foo-2)
bar-2
Baz-2
(exit 0)

View file

@ -0,0 +1,38 @@
;;; This is the union runtime testcase. It ensures that values within a
;;; union embedded within a struct can be set and read correctly.
(load-extension "unions.so")
;; Create new instances of SmallStruct and BigStruct for later use
(define small (new-SmallStruct))
(SmallStruct-jill-set small 200)
(define big (new-BigStruct))
(BigStruct-smallstruct-set big small)
(BigStruct-jack-set big 300)
;; Use SmallStruct then BigStruct to setup EmbeddedUnionTest.
;; Ensure values in EmbeddedUnionTest are set correctly for each.
(define eut (new-EmbeddedUnionTest))
;; First check the SmallStruct in EmbeddedUnionTest
(EmbeddedUnionTest-number-set eut 1)
(EmbeddedUnionTest-uni-small-set (EmbeddedUnionTest-uni-get eut)
small)
(let ((Jill1 (SmallStruct-jill-get
(EmbeddedUnionTest-uni-small-get
(EmbeddedUnionTest-uni-get eut)))))
(if (not (= Jill1 200))
(begin
(display "Runtime test 1 failed.")
(exit 1))))
(let ((Num1 (EmbeddedUnionTest-number-get eut)))
(if (not (= Num1 1))
(begin
(display "Runtime test 2 failed.")
(exit 1))))
;; that should do
(exit 0)