Merge latest master into doxygen branch again.
Update Doxygen-specific Python unit tests to work with the new indentation. Update one of Doxygen-specific Java tests to still build with the new handling of srcdir.
This commit is contained in:
commit
6cce652762
557 changed files with 4998 additions and 4138 deletions
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = allegrocl
|
||||
ALLEGROCL = @ALLEGROCLBIN@
|
||||
SCRIPTSUFFIX = _runme.lisp
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -114,12 +115,12 @@ include $(srcdir)/../common.mk
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.lisp appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(ALLEGROCLBIN) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(ALLEGROCLBIN) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
%.clean:
|
||||
@rm -f $*.cl
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile allegrocl_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" allegrocl_clean
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = cffi
|
||||
CFFI = @CFFIBIN@
|
||||
SCRIPTSUFFIX = _runme.lisp
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -38,8 +39,8 @@ CPP_TEST_CASES =
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.lisp appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CFFI) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: (does nothing, we dont generate extra cffi code)
|
||||
|
|
@ -47,4 +48,4 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile cffi_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" cffi_clean
|
||||
|
|
|
|||
|
|
@ -6,9 +6,11 @@ LANGUAGE = chicken
|
|||
VARIANT =
|
||||
SCRIPTSUFFIX = _runme.ss
|
||||
PROXYSUFFIX = _runme_proxy.ss
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
CHICKEN_CSI = @CHICKEN_CSI@ -quiet -batch -no-init
|
||||
SO = @SO@
|
||||
|
||||
|
|
@ -43,7 +45,7 @@ SWIGOPT += -nounit
|
|||
$(setup)
|
||||
+$(swig_and_compile_cpp)
|
||||
$(run_testcase)
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
|
||||
$(MAKE) $*.cppproxy; \
|
||||
fi
|
||||
|
||||
|
|
@ -51,7 +53,7 @@ SWIGOPT += -nounit
|
|||
$(setup)
|
||||
+$(swig_and_compile_c)
|
||||
$(run_testcase)
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
|
||||
$(MAKE) $*.cproxy; \
|
||||
fi
|
||||
|
||||
|
|
@ -59,7 +61,7 @@ SWIGOPT += -nounit
|
|||
$(setup)
|
||||
+$(swig_and_compile_multi_cpp)
|
||||
$(run_testcase)
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then \
|
||||
$(MAKE) $*.multiproxy; \
|
||||
fi
|
||||
|
||||
|
|
@ -86,8 +88,8 @@ SWIGOPT += -nounit
|
|||
# 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) $(CHICKEN_CSI) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CHICKEN_CSI) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean
|
||||
|
|
@ -95,5 +97,5 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile chicken_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" chicken_clean
|
||||
rm -f *.scm
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = clisp
|
||||
CLISP = @CLISPBIN@
|
||||
SCRIPTSUFFIX = _runme.lisp
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -38,8 +39,8 @@ CPP_TEST_CASES =
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.lisp appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CLISP) -batch -s $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(CLISP) -batch -s $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: (does nothing, we dont generate extra clisp code)
|
||||
|
|
@ -47,4 +48,4 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile clisp_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" clisp_clean
|
||||
|
|
|
|||
|
|
@ -69,7 +69,13 @@ INCLUDES = -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)
|
|||
LIBS = -L.
|
||||
LIBPREFIX = lib
|
||||
ACTION = check
|
||||
INTERFACEDIR = $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/
|
||||
INTERFACEDIR = ../
|
||||
SRCDIR = $(srcdir)/
|
||||
SCRIPTDIR = $(srcdir)
|
||||
|
||||
# Regenerate Makefile if Makefile.in or config.status have changed.
|
||||
Makefile: $(srcdir)/Makefile.in ../../../config.status
|
||||
cd ../../../ && $(SHELL) ./config.status $(EXAMPLES)/$(TEST_SUITE)/$(LANGUAGE)/Makefile
|
||||
|
||||
#
|
||||
# Please keep test cases in alphabetical order.
|
||||
|
|
@ -204,6 +210,7 @@ CPP_TEST_CASES += \
|
|||
enum_template \
|
||||
enum_thorough \
|
||||
enum_var \
|
||||
equality \
|
||||
evil_diamond \
|
||||
evil_diamond_ns \
|
||||
evil_diamond_prop \
|
||||
|
|
@ -409,7 +416,6 @@ CPP_TEST_CASES += \
|
|||
template_partial_specialization \
|
||||
template_partial_specialization_typedef \
|
||||
template_qualifier \
|
||||
template_qualifier \
|
||||
template_ref_type \
|
||||
template_rename \
|
||||
template_retvalue \
|
||||
|
|
@ -468,6 +474,7 @@ CPP_TEST_CASES += \
|
|||
typemap_various \
|
||||
typename \
|
||||
types_directive \
|
||||
unicode_strings \
|
||||
union_scope \
|
||||
using1 \
|
||||
using2 \
|
||||
|
|
@ -623,6 +630,7 @@ C_TEST_CASES += \
|
|||
memberin_extend_c \
|
||||
name \
|
||||
nested \
|
||||
nested_extend_c \
|
||||
nested_structs \
|
||||
newobject2 \
|
||||
overload_extend \
|
||||
|
|
@ -707,14 +715,14 @@ partialcheck:
|
|||
$(MAKE) check CC=true CXX=true LDSHARED=true CXXSHARED=true RUNTOOL=true COMPILETOOL=true
|
||||
|
||||
swig_and_compile_cpp = \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)$*$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$*.i" \
|
||||
$(LANGUAGE)$(VARIANT)_cpp
|
||||
|
||||
swig_and_compile_c = \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CSRCS="$(CSRCS)" \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CSRCS="$(CSRCS)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)$*$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$*.i" \
|
||||
|
|
@ -722,7 +730,7 @@ swig_and_compile_c = \
|
|||
|
||||
swig_and_compile_multi_cpp = \
|
||||
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$$f.i" \
|
||||
|
|
@ -730,11 +738,11 @@ swig_and_compile_multi_cpp = \
|
|||
done
|
||||
|
||||
swig_and_compile_external = \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \
|
||||
TARGET="$*_wrap_hdr.h" \
|
||||
$(LANGUAGE)$(VARIANT)_externalhdr; \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS) $*_external.cxx" \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS) $*_external.cxx" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)$*$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$*.i" \
|
||||
|
|
@ -743,7 +751,7 @@ swig_and_compile_external = \
|
|||
swig_and_compile_runtime = \
|
||||
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ CSHARPCILINTERPRETER = @CSHARPCILINTERPRETER@
|
|||
CSHARPCILINTERPRETER_FLAGS = @CSHARPCILINTERPRETER_FLAGS@
|
||||
CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@"
|
||||
CSHARPCYGPATH_W = @CSHARPCYGPATH_W@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = ../@top_srcdir@
|
||||
top_builddir = ../@top_builddir@
|
||||
|
|
@ -30,6 +31,7 @@ CPP_TEST_CASES = \
|
|||
include $(srcdir)/../common.mk
|
||||
|
||||
# Overridden variables here
|
||||
SRCDIR = ../$(srcdir)/
|
||||
SWIGOPT += -namespace $*Namespace
|
||||
|
||||
CSHARPFLAGSSPECIAL =
|
||||
|
|
@ -57,7 +59,7 @@ csharp_swig2_compatibility.cpptest: SWIGOPT += -DSWIG2_CSHARP
|
|||
|
||||
# Makes a directory for the testcase if it does not exist
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \
|
||||
|
|
@ -71,10 +73,10 @@ setup = \
|
|||
# Note C# uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows and SHLIB_PATH on HPUX.
|
||||
# DYLD_FALLBACK_LIBRARY_PATH is cleared for MacOSX.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \
|
||||
CSHARPFLAGS='-nologo -debug+ $(CSHARPFLAGSSPECIAL) -out:$*_runme.exe' \
|
||||
CSHARPSRCS='`$(CSHARPCYGPATH_W) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \
|
||||
CSHARPSRCS='`$(CSHARPCYGPATH_W) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \
|
||||
env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" DYLD_FALLBACK_LIBRARY_PATH= $(RUNTOOL) $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$*_runme.exe; \
|
||||
else \
|
||||
cd $* && \
|
||||
|
|
|
|||
|
|
@ -323,7 +323,9 @@ public class TestThread {
|
|||
} catch (ArgumentOutOfRangeException e) {
|
||||
String expectedMessage = "caught:" + i + "\n" + "Parameter name: input";
|
||||
if (e.Message.Replace(runme.CRLF,"\n") != expectedMessage)
|
||||
throw new Exception("Exception message incorrect. Expected:\n[" + expectedMessage + "]\n" + "Received:\n[" + e.Message + "]");
|
||||
throw new Exception("Exception message incorrect. Expected:\n[" +
|
||||
expectedMessage + "]\n" + "Received:\n[" +
|
||||
e.Message + "]");
|
||||
if (e.ParamName != "input")
|
||||
throw new Exception("Exception ParamName incorrect. Expected:\n[input]\n" + "Received:\n[" + e.ParamName + "]");
|
||||
if (e.InnerException != null)
|
||||
|
|
@ -333,7 +335,7 @@ public class TestThread {
|
|||
throw new Exception("throwsException.dub = " + throwsClass.dub + " expected: 1234.5678");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Console.Error.WriteLine("Test failed (thread " + threadId + "): " + e.Message);
|
||||
Console.Error.WriteLine("Test failed (thread " + threadId + "): " + e.Message + "\n TestThread Inner stack trace: " + e.StackTrace);
|
||||
Failed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@
|
|||
#######################################################################
|
||||
|
||||
LANGUAGE = d
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = ../@top_srcdir@
|
||||
top_builddir = ../@top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
ifeq (2,$(D_VERSION))
|
||||
VERSIONSUFFIX = .2
|
||||
|
|
@ -13,7 +14,7 @@ else
|
|||
VERSIONSUFFIX = .1
|
||||
endif
|
||||
|
||||
TESTSUFFIX = _runme$(VERSIONSUFFIX).d
|
||||
SCRIPTSUFFIX = _runme$(VERSIONSUFFIX).d
|
||||
|
||||
CPP_TEST_CASES = \
|
||||
d_nativepointers \
|
||||
|
|
@ -45,7 +46,7 @@ SWIGOPT+=-splitproxy -package $*
|
|||
|
||||
# Makes a directory for the testcase if it does not exist
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \
|
||||
|
|
@ -60,11 +61,11 @@ setup = \
|
|||
# Compiles D files then runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.d appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
cd $*$(VERSIONSUFFIX) && \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
|
||||
DFLAGS='-of$*_runme' \
|
||||
DSRCS='../$(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) `find $* -name *.d`' d_compile && \
|
||||
DSRCS='../$(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) `find $* -name *.d`' d_compile && \
|
||||
env LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" $(RUNTOOL) ./$*_runme; \
|
||||
else \
|
||||
cd $*$(VERSIONSUFFIX) && \
|
||||
|
|
|
|||
69
Examples/test-suite/equality.i
Normal file
69
Examples/test-suite/equality.i
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/* File : equality.i */
|
||||
/*
|
||||
Specific test for operator== overload. Partially overlaps with
|
||||
operator_overload.i
|
||||
*/
|
||||
|
||||
%module equality
|
||||
|
||||
%warnfilter(SWIGWARN_LANG_IDENTIFIER) operator==;
|
||||
|
||||
%inline %{
|
||||
|
||||
/* Point has no equality operator */
|
||||
typedef struct Point
|
||||
{
|
||||
double x;
|
||||
double y;
|
||||
} Point;
|
||||
|
||||
static const Point s_zeroPoint = { 0.0, 0.0 };
|
||||
/* stack version */
|
||||
Point MakePoint(double x, double y)
|
||||
{ Point new_point = {x, y}; return new_point; }
|
||||
|
||||
const Point* GetZeroPointPtr() { return &s_zeroPoint; }
|
||||
Point GetZeroPointCopy() { return s_zeroPoint; }
|
||||
|
||||
/* EqualOpDefined has correct equality operator */
|
||||
class EqualOpDefined {
|
||||
public:
|
||||
EqualOpDefined():
|
||||
x(5) {}
|
||||
EqualOpDefined(int val):
|
||||
x(val) {}
|
||||
|
||||
int x;
|
||||
};
|
||||
|
||||
/* EqualOpWrong has logically incorrect equality operator */
|
||||
class EqualOpWrong {
|
||||
public:
|
||||
inline static const EqualOpWrong* GetStaticObject();
|
||||
};
|
||||
|
||||
static EqualOpWrong s_wrongEqOp;
|
||||
|
||||
const EqualOpWrong* EqualOpWrong::GetStaticObject()
|
||||
{ return &s_wrongEqOp; }
|
||||
|
||||
|
||||
inline bool operator==( const EqualOpDefined& first, const EqualOpDefined& second )
|
||||
{ return first.x == second.x; }
|
||||
|
||||
inline bool operator==( const EqualOpWrong& first, const EqualOpWrong& second )
|
||||
{ return false; }
|
||||
|
||||
%}
|
||||
|
||||
/*
|
||||
in order to wrapper this correctly
|
||||
we need to extend the class
|
||||
to make the friends & non members part of the class
|
||||
*/
|
||||
%extend EqualOpDefined {
|
||||
bool operator==(const EqualOpDefined& b){return (*$self) == b;}
|
||||
}
|
||||
%extend EqualOpWrong {
|
||||
bool operator==(const EqualOpWrong& b){return (*$self) == b;}
|
||||
}
|
||||
|
|
@ -13,18 +13,15 @@
|
|||
# file (.stderr) in addition to the test case itself.
|
||||
#######################################################################
|
||||
|
||||
LANGUAGE = python
|
||||
LANGUAGE = errors
|
||||
ERROR_EXT = newerr
|
||||
# Portable dos2unix / todos for stripping CR
|
||||
TODOS = tr -d '\r'
|
||||
#TODOS = sed -e 's/\r$$//' # On OSX behaves as if written 's/r$$//'
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
# All .i files with prefix 'cpp_' will be treated as C++ input and remaining .i files as C input
|
||||
ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(wildcard *.i))
|
||||
ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i)))
|
||||
CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES))
|
||||
C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES))
|
||||
|
||||
|
|
@ -33,21 +30,27 @@ ERROR_TEST_CASES := $(CPP_ERROR_TEST_CASES:=.cpptest) \
|
|||
|
||||
include $(srcdir)/../common.mk
|
||||
|
||||
# Portable dos2unix / todos for stripping CR
|
||||
TODOS = tr -d '\r'
|
||||
#TODOS = sed -e 's/\r$$//' # On OSX behaves as if written 's/r$$//'
|
||||
|
||||
# strip source directory from output, so that diffs compare
|
||||
STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||'
|
||||
|
||||
# Rules for the different types of tests
|
||||
%.cpptest:
|
||||
echo "$(ACTION)ing errors testcase $*"
|
||||
-$(SWIG) -c++ -python -Wall -Fstandard $(SWIGOPT) $*.i 2>&1 | $(TODOS) > $*.$(ERROR_EXT)
|
||||
$(COMPILETOOL) diff -c $*.stderr $*.$(ERROR_EXT)
|
||||
-$(SWIG) -c++ -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
|
||||
$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
|
||||
|
||||
%.ctest:
|
||||
echo "$(ACTION)ing errors testcase $*"
|
||||
-$(SWIG) -python -Wall -Fstandard $(SWIGOPT) $*.i 2>&1 | $(TODOS) > $*.$(ERROR_EXT)
|
||||
$(COMPILETOOL) diff -c $*.stderr $*.$(ERROR_EXT)
|
||||
-$(SWIG) -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
|
||||
$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
|
||||
|
||||
%.clean:
|
||||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile $(LANGUAGE)_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" python_clean
|
||||
@rm -f *.$(ERROR_EXT) *.py
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ include $(srcdir)/../common.mk
|
|||
multi_import.multicpptest:
|
||||
$(setup)
|
||||
for f in multi_import_b multi_import_a; do \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" CXXSRCS="$(CXXSRCS)" \
|
||||
SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \
|
||||
INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
|
||||
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$$f.i" \
|
||||
|
|
@ -57,8 +57,8 @@ multi_import.multicpptest:
|
|||
|
||||
# Runs the testcase.
|
||||
run_testcase = \
|
||||
if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if $(GOGCC) ; then \
|
||||
$(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.@OBJEXT@ $*_wrap.@OBJEXT@; \
|
||||
elif $(GO12) || $(GO13); then \
|
||||
|
|
@ -70,8 +70,8 @@ run_testcase = \
|
|||
fi
|
||||
|
||||
run_testcase_cpp = \
|
||||
if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if $(GOGCC) ; then \
|
||||
$(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.@OBJEXT@ $*_wrap.@OBJEXT@ -lstdc++; \
|
||||
elif $(GO12) || $(GO13); then \
|
||||
|
|
@ -83,8 +83,8 @@ run_testcase_cpp = \
|
|||
fi
|
||||
|
||||
run_multi_testcase = \
|
||||
if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if $(GOGCC) ; then \
|
||||
files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \
|
||||
$(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ `for f in $$files; do echo $$f.@OBJEXT@ $${f}_wrap.@OBJEXT@; done` -lstdc++; \
|
||||
|
|
@ -100,11 +100,12 @@ run_multi_testcase = \
|
|||
@rm -f $*.go $*_gc.c $*_wrap.* $*_runme
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile go_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" go_clean
|
||||
rm -f mod_a.go mod_b.go imports_a.go imports_b.go
|
||||
rm -f clientdata_prop_a.go clientdata_prop_b.go
|
||||
rm -f multi_import_a.go multi_import_b.go
|
||||
rm -f packageoption_a.go packageoption_b.go packageoption_c.go
|
||||
rm -f import_stl_a.go import_stl_b.go
|
||||
|
||||
cvsignore:
|
||||
@echo '*_gc.c *_wrap.* *.so *.dll *.exp *.lib'
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@ EXTRA_TEST_CASES += guile_ext_test.externaltest
|
|||
LANGUAGE = guile
|
||||
VARIANT =
|
||||
SCRIPTSUFFIX = _runme.scm
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
GUILE = @GUILE@
|
||||
GUILE_RUNTIME=
|
||||
|
||||
|
|
@ -51,8 +53,8 @@ INCLUDES += -I$(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/guile
|
|||
# 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 GUILE_AUTO_COMPILE=0 LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(GUILE) -l $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env GUILE_AUTO_COMPILE=0 LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(GUILE) -l $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean
|
||||
|
|
@ -60,4 +62,4 @@ run_testcase = \
|
|||
@rm -f $*-guile
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile guile_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" guile_clean
|
||||
|
|
|
|||
|
|
@ -10,15 +10,16 @@
|
|||
#include <math.h>
|
||||
|
||||
/* C99 math.h defines INFINITY. If not available, this is the fallback. */
|
||||
#ifndef INFINITY
|
||||
#ifdef _MSC_VER
|
||||
#if !defined(INFINITY)
|
||||
#if defined(_MSC_VER)
|
||||
union MSVC_EVIL_FLOAT_HACK
|
||||
{
|
||||
unsigned __int8 Bytes[4];
|
||||
float Value;
|
||||
};
|
||||
static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};
|
||||
const union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};
|
||||
#define INFINITY (INFINITY_HACK.Value)
|
||||
#define INFINITY_NO_CONST
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
|
@ -33,15 +34,28 @@
|
|||
#define INFINITY (1e1000)
|
||||
#endif
|
||||
#endif
|
||||
%}
|
||||
|
||||
%inline %{
|
||||
/* This will allow us to bind the real INFINITY value through SWIG via MYINFINITY. Use %rename to fix the name. */
|
||||
#ifdef INFINITY_NO_CONST
|
||||
/* To void: error C2099: initializer is not a constant */
|
||||
double MYINFINITY = 0.0;
|
||||
void initialise_MYINFINITY(void) {
|
||||
MYINFINITY = INFINITY;
|
||||
}
|
||||
#else
|
||||
const double MYINFINITY = INFINITY;
|
||||
void initialise_MYINFINITY(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Use of float is intentional because the original bug was in the float conversion due to overflow checking. */
|
||||
float use_infinity(float inf_val)
|
||||
{
|
||||
return inf_val;
|
||||
}
|
||||
%}
|
||||
|
||||
/* This will allow us to bind the real INFINITY value through SWIG via MYINFINITY. Use %rename to fix the name. */
|
||||
const double MYINFINITY = INFINITY;
|
||||
void initialise_MYINFINITY(void);
|
||||
/* Use of float is intentional because the original bug was in the float conversion due to overflow checking. */
|
||||
float use_infinity(float inf_val);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ JAVA = @JAVA@
|
|||
JAVAC = @JAVAC@
|
||||
JAVAFLAGS = -Xcheck:jni
|
||||
SCRIPTSUFFIX = _runme.java
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = ../@top_srcdir@
|
||||
top_builddir = ../@top_builddir@
|
||||
|
|
@ -48,6 +49,7 @@ DOXYGEN_TEST_CASES := \
|
|||
include $(srcdir)/../common.mk
|
||||
|
||||
# Overridden variables here
|
||||
SRCDIR = ../$(srcdir)/
|
||||
JAVA_PACKAGE = $*
|
||||
JAVA_PACKAGEOPT = -package $(JAVA_PACKAGE)
|
||||
SWIGOPT += $(JAVA_PACKAGEOPT)
|
||||
|
|
@ -59,6 +61,7 @@ nspace.%: JAVA_PACKAGE = $*Package
|
|||
nspace_extend.%: JAVA_PACKAGE = $*Package
|
||||
director_nspace.%: JAVA_PACKAGE = $*Package
|
||||
director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
|
||||
doxygen_misc_constructs.%: INCLUDES = -I../$(srcdir)/..
|
||||
|
||||
# Rules for the different types of tests
|
||||
%.cpptest:
|
||||
|
|
@ -78,7 +81,7 @@ director_nspace_director_name_collision.%: JAVA_PACKAGE = $*Package
|
|||
|
||||
# Makes a directory for the testcase if it does not exist
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $* (with run test)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing $(LANGUAGE) testcase $*" ; \
|
||||
|
|
@ -98,8 +101,8 @@ $(DOXYGEN_TEST_CASES:=.cpptest): DOXYGEN_COMMENT_PARSER := $(srcdir)/CommentPars
|
|||
# Note Java uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows, SHLIB_PATH on HPUX and DYLD_LIBRARY_PATH on Mac OS X.
|
||||
run_testcase = \
|
||||
cd $(JAVA_PACKAGE) && $(COMPILETOOL) $(JAVAC) -classpath . `find . -name "*.java"` && cd .. && \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(JAVAC) -classpath $(JAVA_CLASSPATH) -d . $(DOXYGEN_COMMENT_PARSER) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(JAVAC) -classpath $(JAVA_CLASSPATH) -d . $(DOXYGEN_COMMENT_PARSER) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||
env LD_LIBRARY_PATH="$(JAVA_PACKAGE):$$LD_LIBRARY_PATH" PATH="$(JAVA_PACKAGE):$$PATH" SHLIB_PATH="$(JAVA_PACKAGE):$$SHLIB_PATH" DYLD_LIBRARY_PATH="$(JAVA_PACKAGE):$$DYLD_LIBRARY_PATH" $(RUNTOOL) $(JAVA) $(JAVAFLAGS) -classpath $(JAVA_CLASSPATH) $*_runme; \
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class li_boost_intrusive_ptr_runme {
|
|||
// Change loop count to run for a long time to monitor memory
|
||||
final int loopCount = 5000; //5000;
|
||||
for (int i=0; i<loopCount; i++) {
|
||||
new li_boost_intrusive_ptr_runme().runtest();
|
||||
new li_boost_intrusive_ptr_runme().runtest(i);
|
||||
System.gc();
|
||||
System.runFinalization();
|
||||
try {
|
||||
|
|
@ -78,7 +78,9 @@ public class li_boost_intrusive_ptr_runme {
|
|||
System.out.println("Finished");
|
||||
}
|
||||
|
||||
private void runtest() {
|
||||
private int loopCount = 0;
|
||||
private void runtest(int loopCount) {
|
||||
this.loopCount = loopCount;
|
||||
// simple shared_ptr usage - created in C++
|
||||
{
|
||||
Klass k = new Klass("me oh my");
|
||||
|
|
@ -671,36 +673,36 @@ private void toIgnore() {
|
|||
}
|
||||
private void verifyValue(String expected, String got) {
|
||||
if (!expected.equals(got))
|
||||
throw new RuntimeException("verify value failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify value failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyCount(int expected, Klass k) {
|
||||
int got = li_boost_intrusive_ptr.use_count(k);
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyCount(int expected, KlassDerived kd) {
|
||||
int got = li_boost_intrusive_ptr.use_count(kd);
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyCount(int expected, KlassDerivedDerived kdd) {
|
||||
int got = li_boost_intrusive_ptr.use_count(kdd);
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyIntrusiveCount(int expected, Klass k) {
|
||||
int got = k.use_count();
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyIntrusiveCount(int expected, KlassDerived kd) {
|
||||
int got = kd.use_count();
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
private void verifyIntrusiveCount(int expected, KlassDerivedDerived kdd) {
|
||||
int got = kdd.use_count();
|
||||
if (expected != got)
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got);
|
||||
throw new RuntimeException("verify use_count failed. Expected: " + expected + " Got: " + got + " loopCount: " + loopCount);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
45
Examples/test-suite/java/nested_extend_c_runme.java
Normal file
45
Examples/test-suite/java/nested_extend_c_runme.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import nested_extend_c.*;
|
||||
|
||||
public class nested_extend_c_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("nested_extend_c");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[]) throws Throwable
|
||||
{
|
||||
{
|
||||
hiA hi = new hiA();
|
||||
if (hi.hi_extend() != 'h')
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
lowA low = new lowA();
|
||||
if (low.low_extend() != 99)
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
|
||||
{
|
||||
hiB hi = new hiB();
|
||||
if (hi.hi_extend() != 'h')
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
lowB low = new lowB();
|
||||
if (low.low_extend() != 99)
|
||||
throw new RuntimeException("test failed");
|
||||
}
|
||||
{
|
||||
FOO_bar foobar = new FOO_bar();
|
||||
foobar.setD(1234);
|
||||
if (foobar.getD() != 1234)
|
||||
throw new RuntimeException("test failed");
|
||||
foobar.bar_extend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,13 +13,21 @@ public class preproc_line_file_runme {
|
|||
|
||||
private static void test_file(String file, String suffix) throws Throwable
|
||||
{
|
||||
String FILENAME_WINDOWS = "Examples\\test-suite\\preproc_line_file.i";
|
||||
String FILENAME_UNIX = "Examples/test-suite/preproc_line_file.i";
|
||||
// For swig-3.0.1 and earlier
|
||||
// String FILENAME_WINDOWS = "Examples\\test-suite\\preproc_line_file.i";
|
||||
// String FILENAME_UNIX = "Examples/test-suite/preproc_line_file.i";
|
||||
|
||||
String FILENAME_WINDOWS2 = "Examples\\test-suite\\java\\..\\preproc_line_file.i";
|
||||
String FILENAME_UNIX2 = "Examples/test-suite/java/../preproc_line_file.i";
|
||||
|
||||
String FILENAME_WINDOWS3 = "..\\.\\..\\preproc_line_file.i";
|
||||
String FILENAME_UNIX3 = ".././../preproc_line_file.i";
|
||||
|
||||
// We don't test for exact equality here because the file names are relative to the build directory, which can be different from the source directory,
|
||||
// under Unix. But they do need to end with the same path components.
|
||||
if (!file.endsWith(FILENAME_UNIX + suffix) && !file.endsWith(FILENAME_WINDOWS + suffix))
|
||||
throw new RuntimeException("file \"" + file + "\" doesn't end with " + FILENAME_UNIX + suffix);
|
||||
if (!file.endsWith(FILENAME_UNIX2 + suffix) && !file.endsWith(FILENAME_WINDOWS2 + suffix) &&
|
||||
!file.endsWith(FILENAME_UNIX3 + suffix) && !file.endsWith(FILENAME_WINDOWS3 + suffix))
|
||||
throw new RuntimeException("file \"" + file + "\" doesn't end with " + FILENAME_UNIX2 + suffix + " or " + FILENAME_UNIX3 + suffix);
|
||||
}
|
||||
|
||||
public static void main(String argv[]) throws Throwable
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@
|
|||
|
||||
LANGUAGE = javascript
|
||||
NODEGYP = @NODEGYP@
|
||||
NODEJS = @NODEJS@
|
||||
SCRIPTSUFFIX = _runme.js
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
SWIG = $(top_builddir)/preinst_swig
|
||||
|
||||
ifneq (, $(ENGINE))
|
||||
|
|
@ -19,20 +22,12 @@ endif
|
|||
include $(srcdir)/../common.mk
|
||||
|
||||
_setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $* (with run test)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $*" ; \
|
||||
fi;
|
||||
|
||||
ifneq (jsc,$(ENGINE))
|
||||
|
||||
# This test can not be run with v8 as it uses v8 API incompatible output typemaps
|
||||
typemap_variables.cpptest:
|
||||
echo "skipping $(LANGUAGE) ($(JSENGINE)) testcase typemap_variables" ;
|
||||
|
||||
endif
|
||||
|
||||
ifeq (node,$(JSENGINE))
|
||||
|
||||
SWIGOPT += -v8 -DBUILDING_NODE_EXTENSION=1
|
||||
|
|
@ -47,20 +42,27 @@ ifeq (node,$(JSENGINE))
|
|||
constant_pointers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
enum_thorough.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
|
||||
setup_node = \
|
||||
test -d $* || mkdir $*; \
|
||||
sed -e 's|$$testcase|$*|g; s|$$cflags|$(GYP_CFLAGS)|g; s|$$srcdir|$(srcdir)|g' \
|
||||
$(srcdir)/node_template/binding.gyp.in > $*/binding.gyp; \
|
||||
sed -e 's|$$testcase|$*|g;' \
|
||||
$(srcdir)/node_template/index.js.in > $*/index.js
|
||||
|
||||
# Note: we need to use swig in C parse mode, but make node-gyp believe it is c++ (via file extension)
|
||||
swig_and_compile_c = \
|
||||
sh ./setup_test.sh $* $(GYP_CFLAGS); \
|
||||
$(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx ../$*.i; \
|
||||
$(setup_node); \
|
||||
$(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx $(srcdir)/../$*.i; \
|
||||
$(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null
|
||||
|
||||
swig_and_compile_cpp = \
|
||||
sh ./setup_test.sh $* $(GYP_CFLAGS); \
|
||||
$(SWIG) -c++ -javascript $(SWIGOPT) ../$*.i; \
|
||||
$(setup_node); \
|
||||
$(SWIG) -c++ -javascript $(SWIGOPT) $(srcdir)/../$*.i; \
|
||||
$(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null
|
||||
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
|
||||
node $(srcdir)/$*$(SCRIPTSUFFIX); \
|
||||
env NODE_PATH=$$PWD:$(srcdir) $(NODEJS) $(srcdir)/$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
|
||||
|
|
@ -83,7 +85,7 @@ else
|
|||
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(top_srcdir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \
|
||||
$(RUNTOOL) $(top_builddir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
%.ctest:
|
||||
|
|
@ -105,10 +107,15 @@ endif
|
|||
|
||||
|
||||
%.clean:
|
||||
rm -rf $*
|
||||
@rm -rf $*
|
||||
@rm -f $*_wrap.* $*.so $*.o
|
||||
|
||||
clean:
|
||||
rm -f *_wrap.cxx
|
||||
rm -f *_wrap.c
|
||||
rm -f *.so
|
||||
rm -f *.o
|
||||
for ext in _wrap.cxx _wrap.o .so; do \
|
||||
rm -f clientdata_prop_a$${ext} clientdata_prop_b$${ext}; \
|
||||
rm -f imports_a$${ext} imports_b$${ext}; \
|
||||
rm -f import_stl_a$${ext} import_stl_b$${ext}; \
|
||||
rm -f mod_a$${ext} mod_b$${ext}; \
|
||||
rm -f multi_import_a$${ext} multi_import_b$${ext}; \
|
||||
rm -f packageoption_a$${ext} packageoption_b$${ext} packageoption_c$${ext}; \
|
||||
done
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var abstract_access = require("./abstract_access");
|
||||
var abstract_access = require("abstract_access");
|
||||
|
||||
var d = new abstract_access.D()
|
||||
if (d.do_x() != 1) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var abstract_inherit = require("./abstract_inherit");
|
||||
var abstract_inherit = require("abstract_inherit");
|
||||
|
||||
// Shouldn't be able to instantiate any of these classes
|
||||
// since none of them implements the pure virtual function
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var abstract_typedef2 = require("./abstract_typedef2");
|
||||
var abstract_typedef2 = require("abstract_typedef2");
|
||||
|
||||
var a = new abstract_typedef2.A_UF();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var abstract_typedef = require("./abstract_typedef");
|
||||
var abstract_typedef = require("abstract_typedef");
|
||||
|
||||
var e = new abstract_typedef.Engine();
|
||||
var a = new abstract_typedef.A()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var abstract_virtual = require("./abstract_virtual");
|
||||
var abstract_virtual = require("abstract_virtual");
|
||||
|
||||
d = new abstract_virtual.D()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var array_member = require("./array_member");
|
||||
var array_member = require("array_member");
|
||||
|
||||
var f = new array_member.Foo();
|
||||
f.data = array_member.global_data;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var arrays_global = require("./arrays_global");
|
||||
var arrays_global = require("arrays_global");
|
||||
|
||||
arrays_global.array_i = arrays_global.array_const_i;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var callback = require("./callback");
|
||||
var callback = require("callback");
|
||||
|
||||
if (callback.foo(2) !== 2) {
|
||||
throw new Error("Failed.");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var char_binary = require("./char_binary");
|
||||
var char_binary = require("char_binary");
|
||||
|
||||
var t = new char_binary.Test();
|
||||
if (t.strlen('hile') != 4) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var char_strings = require("./char_strings");
|
||||
var char_strings = require("char_strings");
|
||||
|
||||
var assertIsEqual = function(expected, actual) {
|
||||
if (expected !== actual) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var class_ignore = require("./class_ignore");
|
||||
var class_ignore = require("class_ignore");
|
||||
|
||||
a = new class_ignore.Bar();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var class_scope_weird = require("./class_scope_weird");
|
||||
var class_scope_weird = require("class_scope_weird");
|
||||
|
||||
f = new class_scope_weird.Foo();
|
||||
g = new class_scope_weird.Foo(3);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var complextest = require("./complextest");
|
||||
var complextest = require("complextest");
|
||||
|
||||
a = [-1,2];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var constover = require("./constover");
|
||||
var constover = require("constover");
|
||||
|
||||
p = constover.test("test");
|
||||
if (p != "test") {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var constructor_copy = require("./constructor_copy");
|
||||
var constructor_copy = require("constructor_copy");
|
||||
|
||||
f1 = new constructor_copy.Foo1(3);
|
||||
f11 = new constructor_copy.Foo1(f1);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var cpp_enum = require("./cpp_enum");
|
||||
var cpp_enum = require("cpp_enum");
|
||||
|
||||
var f = new cpp_enum.Foo()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var cpp_namespace = require("./cpp_namespace");
|
||||
var cpp_namespace = require("cpp_namespace");
|
||||
|
||||
var n = cpp_namespace.fact(4);
|
||||
if (n != 24){
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var cpp_static = require("./cpp_static");
|
||||
var cpp_static = require("cpp_static");
|
||||
|
||||
cpp_static.StaticFunctionTest.static_func();
|
||||
cpp_static.StaticFunctionTest.static_func_2(1);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var director_alternating = require("./director_alternating");
|
||||
var director_alternating = require("director_alternating");
|
||||
|
||||
id = director_alternating.getBar().id();
|
||||
if (id != director_alternating.idFromGetBar())
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var disown = require("./disown");
|
||||
var disown = require("disown");
|
||||
|
||||
var a = new disown.A();
|
||||
var tmp = a.thisown;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var dynamic_cast = require("./dynamic_cast");
|
||||
var dynamic_cast = require("dynamic_cast");
|
||||
|
||||
var f = new dynamic_cast.Foo();
|
||||
var b = new dynamic_cast.Bar();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
var empty = require("./empty");
|
||||
var empty = require("empty");
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
var enum_template = require("./enum_template");
|
||||
var enum_template = require("enum_template");
|
||||
|
||||
if (enum_template.MakeETest() != 1)
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
var infinity = require("./infinity");
|
||||
var infinity = require("infinity");
|
||||
|
||||
infinity.initialise_MYINFINITY();
|
||||
var my_infinity = infinity.INFINITY;
|
||||
var ret_val = infinity.use_infinity(my_infinity);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
var namespace_virtual_method = require("./namespace_virtual_method");
|
||||
var namespace_virtual_method = require("namespace_virtual_method");
|
||||
|
||||
x = new namespace_virtual_method.Spam();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
{
|
||||
"target_name": "$testcase",
|
||||
"sources":[ "../$testcase_wrap.cxx" ],
|
||||
"include_dirs": ["../.."],
|
||||
"include_dirs": ["../$srcdir/.."],
|
||||
'defines': [
|
||||
'BUILDING_NODE_EXTENSION=1',
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var nspace_extend = require("./nspace_extend");
|
||||
var nspace_extend = require("nspace_extend");
|
||||
|
||||
// constructors and destructors
|
||||
var color1 = new nspace_extend.Outer.Inner1.Color();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var nspace = require("./nspace");
|
||||
var nspace = require("nspace");
|
||||
|
||||
var color1 = new nspace.Outer.Inner1.Color();
|
||||
var color = new nspace.Outer.Inner1.Color(color1);
|
||||
|
|
|
|||
9
Examples/test-suite/javascript/null_pointer_runme.js
Normal file
9
Examples/test-suite/javascript/null_pointer_runme.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
var null_pointer = require("null_pointer");
|
||||
|
||||
if (!null_pointer.func(null)) {
|
||||
throw new Error("Javascript 'null' should be converted into NULL.");
|
||||
}
|
||||
|
||||
if (null_pointer.getnull() != null) {
|
||||
throw new Error("NULL should be converted into Javascript 'null'.");
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
var overload_copy = require("./overload_copy");
|
||||
var overload_copy = require("overload_copy");
|
||||
|
||||
f = new overload_copy.Foo();
|
||||
g = new overload_copy.Foo(f);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var preproc_include = require("./preproc_include");
|
||||
var preproc_include = require("preproc_include");
|
||||
|
||||
if (preproc_include.multiply10(10) != 100)
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var preproc = require("./preproc");
|
||||
var preproc = require("preproc");
|
||||
|
||||
if (preproc.endif != 1)
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var rename = require("./rename1");
|
||||
var rename = require("rename1");
|
||||
|
||||
function part1() {
|
||||
var xyz = new rename.XYZInt();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var rename = require("./rename2");
|
||||
var rename = require("rename2");
|
||||
|
||||
function part1() {
|
||||
var xyz = new rename.XYZInt();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var rename = require("./rename3");
|
||||
var rename = require("rename3");
|
||||
|
||||
function part1() {
|
||||
var xyz = new rename.XYZInt();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var rename = require("./rename4");
|
||||
var rename = require("rename4");
|
||||
|
||||
function part1() {
|
||||
var xyz = new rename.XYZInt();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var rename_scope = require("./rename_scope");
|
||||
var rename_scope = require("rename_scope");
|
||||
|
||||
var a = new rename_scope.Natural_UP();
|
||||
var b = new rename_scope.Natural_BP();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var rename_simple = require("./rename_simple");
|
||||
var rename_simple = require("rename_simple");
|
||||
var NewStruct = rename_simple.NewStruct;
|
||||
|
||||
var s = new NewStruct();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var ret_by_value = require("./ret_by_value");
|
||||
var ret_by_value = require("ret_by_value");
|
||||
|
||||
a = ret_by_value.get_test();
|
||||
if (a.myInt != 100)
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
if [ ! -d $1 ]; then
|
||||
mkdir $1;
|
||||
fi
|
||||
sed -e "s/\$testcase/$1/" -e "s/\$cflags/$2/" < node_template/binding.gyp.in > $1/binding.gyp
|
||||
sed s/\$testcase/$1/ node_template/index.js.in > $1/index.js
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
var string_simple = require("./string_simple");
|
||||
var string_simple = require("string_simple");
|
||||
|
||||
// Test unicode string
|
||||
var str = "olé";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var struct_value = require("./struct_value");
|
||||
var struct_value = require("struct_value");
|
||||
|
||||
b = new struct_value.Bar();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
var template_static = require("./template_static");
|
||||
var template_static = require("template_static");
|
||||
|
||||
template_static.Foo.bar_double(1);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typedef_class = require("./typedef_class");
|
||||
var typedef_class = require("typedef_class");
|
||||
|
||||
a = new typedef_class.RealA();
|
||||
a.a = 3;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typedef_inherit = require("./typedef_inherit");
|
||||
var typedef_inherit = require("typedef_inherit");
|
||||
|
||||
a = new typedef_inherit.Foo();
|
||||
b = new typedef_inherit.Bar();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typedef_scope = require("./typedef_scope");
|
||||
var typedef_scope = require("typedef_scope");
|
||||
|
||||
b = new typedef_scope.Bar();
|
||||
x = b.test1(42,"hello");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typemap_arrays = require("./typemap_arrays");
|
||||
var typemap_arrays = require("typemap_arrays");
|
||||
|
||||
if (typemap_arrays.sumA(null) != 60)
|
||||
throw "RuntimeError, Sum is wrong";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typemap_delete = require("./typemap_delete");
|
||||
var typemap_delete = require("typemap_delete");
|
||||
|
||||
r = new typemap_delete.Rect(123);
|
||||
if (r.val != 123)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typemap_namespace = require("./typemap_namespace");
|
||||
var typemap_namespace = require("typemap_namespace");
|
||||
|
||||
if (typemap_namespace.test1("hello") != "hello")
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var typemap_ns_using = require("./typemap_ns_using");
|
||||
var typemap_ns_using = require("typemap_ns_using");
|
||||
|
||||
if (typemap_ns_using.spam(37) != 37)
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var using1 = require("./using1");
|
||||
var using1 = require("using1");
|
||||
|
||||
if (using1.spam(37) != 37)
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var using2 = require("./using2");
|
||||
var using2 = require("using2");
|
||||
|
||||
if (using2.spam(37) != 37)
|
||||
throw "RuntimeError";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var varargs = require("./varargs");
|
||||
var varargs = require("varargs");
|
||||
|
||||
if (varargs.test("Hello") != "Hello") {
|
||||
throw new Error("Failed");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
// count the instances of intrusive_ptr. Uncomment the INTRUSIVE_PTR_WRAPPER macro to turn this on.
|
||||
//
|
||||
// Also note the debug_shared flag which can be set from the target language.
|
||||
//
|
||||
// Usage of intrusive_ptr_add_ref and intrusive_ptr_release based on boost testing:
|
||||
// http://www.boost.org/doc/libs/1_36_0/libs/smart_ptr/test/intrusive_ptr_test.cpp
|
||||
|
||||
%module li_boost_intrusive_ptr
|
||||
|
||||
|
|
@ -13,10 +16,10 @@
|
|||
%warnfilter(SWIGWARN_LANG_SMARTPTR_MISSING) KlassDerived;
|
||||
%warnfilter(SWIGWARN_LANG_SMARTPTR_MISSING) KlassDerivedDerived;
|
||||
|
||||
%{
|
||||
template<typename T> void intrusive_ptr_add_ref(const T* r) { r->addref(); }
|
||||
template<typename T> void intrusive_ptr_release(const T* r) { r->release(); }
|
||||
%ignore intrusive_ptr_add_ref;
|
||||
%ignore intrusive_ptr_release;
|
||||
|
||||
%{
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
|
|
@ -132,6 +135,8 @@ struct Klass {
|
|||
void release(void) const { if (--count == 0) delete this; }
|
||||
int use_count(void) const { return count; }
|
||||
static long getTotal_count() { return total_count; }
|
||||
friend void intrusive_ptr_add_ref(const Klass* r) { r->addref(); }
|
||||
friend void intrusive_ptr_release(const Klass* r) { r->release(); }
|
||||
|
||||
private:
|
||||
static void increment() { ++total_count; if (debug_shared) cout << " ++xxxxx Klass::increment tot: " << total_count << endl;}
|
||||
|
|
@ -177,6 +182,8 @@ struct IgnoredRefCountingBase {
|
|||
void addref(void) const { ++count; }
|
||||
void release(void) const { if (--count == 0) delete this; }
|
||||
int use_count(void) const { return count; }
|
||||
inline friend void intrusive_ptr_add_ref(const IgnoredRefCountingBase* r) { r->addref(); }
|
||||
inline friend void intrusive_ptr_release(const IgnoredRefCountingBase* r) { r->release(); }
|
||||
static long getTotal_count() { return total_count; }
|
||||
|
||||
private:
|
||||
|
|
@ -414,6 +421,8 @@ template <class T1, class T2> struct Base {
|
|||
void addref(void) const { count++; }
|
||||
void release(void) const { if (--count == 0) delete this; }
|
||||
int use_count(void) const { return count; }
|
||||
inline friend void intrusive_ptr_add_ref(const Base<T1, T2>* r) { r->addref(); }
|
||||
inline friend void intrusive_ptr_release(const Base<T1, T2>* r) { r->release(); }
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = lua
|
||||
LUA = @LUABIN@
|
||||
SCRIPTSUFFIX = _runme.lua
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -46,8 +47,8 @@ lua_no_module_global.%: SWIGOPT += -nomoduleglobal
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.lua appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LUA_PATH="$(srcdir)/?.lua;" $(RUNTOOL) $(LUA) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: (does nothing, we dont generate extra lua code)
|
||||
|
|
@ -55,7 +56,7 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile lua_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" lua_clean
|
||||
|
||||
cvsignore:
|
||||
@echo '*wrap* *.so *.dll *.exp *.lib'
|
||||
|
|
|
|||
|
|
@ -86,3 +86,14 @@ f4_name = tostring(f4)
|
|||
assert( f2_name == "Foo" )
|
||||
assert( f3_name == "Foo" )
|
||||
assert( f4_name == "FooSubSub" )
|
||||
|
||||
-- Test __eq implementation supplied by default
|
||||
|
||||
-- eq_f1 and eq_f2 must be different userdata with same Foo* pointer. If eq_f1 and eq_f2 are the same userdata (e.g.)
|
||||
-- > eq_f1 = smth
|
||||
-- > eq_f2 = eq_f1
|
||||
-- then default Lua equality comparison kicks in and considers them equal. Access to global_fptr is actually a
|
||||
-- function call (internally) and it returns new userdata each time.
|
||||
eq_f1 = cb.Bar.global_fptr
|
||||
eq_f2 = cb.Bar.global_fptr
|
||||
assert( eq_f1 == eq_f2 )
|
||||
|
|
|
|||
47
Examples/test-suite/lua/equality_runme.lua
Normal file
47
Examples/test-suite/lua/equality_runme.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
require("import") -- the import fn
|
||||
import("equality") -- import code
|
||||
eq=equality -- renaming import
|
||||
|
||||
-- catch "undefined" global variables
|
||||
local env = _ENV -- Lua 5.2
|
||||
if not env then env = getfenv () end -- Lua 5.1
|
||||
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||
|
||||
-- === No equality operator ===
|
||||
|
||||
-- logically same data without equality operator are not equal
|
||||
p1 = eq.MakePoint(10,9);
|
||||
p2 = eq.MakePoint(10,9);
|
||||
|
||||
assert( p1 ~= p2 );
|
||||
|
||||
-- different wrappers for same Point* are equal
|
||||
p3 = eq.GetZeroPointPtr()
|
||||
p4 = eq.GetZeroPointPtr()
|
||||
|
||||
assert( p3 == p4 )
|
||||
|
||||
|
||||
-- === Logically correct equality operator ===
|
||||
|
||||
ed1 = eq.EqualOpDefined(10)
|
||||
ed2 = eq.EqualOpDefined(10)
|
||||
ed3 = eq.EqualOpDefined(15)
|
||||
|
||||
assert( ed1 == ed2 )
|
||||
assert( ed1 ~= ed3 )
|
||||
|
||||
|
||||
-- === Logically incorrect equality operator ===
|
||||
|
||||
ew1 = eq.EqualOpWrong()
|
||||
ew2 = eq.EqualOpWrong()
|
||||
|
||||
assert( ew1 ~= ew2 );
|
||||
|
||||
ew3 = eq.EqualOpWrong.GetStaticObject()
|
||||
ew4 = eq.EqualOpWrong.GetStaticObject()
|
||||
|
||||
-- Even though these are pointers to same object, operator== overload should
|
||||
-- state that they are not equal
|
||||
assert( ew3 ~= ew4 )
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
-- demo of lua swig capacilities (operator overloading)
|
||||
-- demo of lua swig capacities (operator overloading)
|
||||
require("import") -- the import fn
|
||||
import("operator_overload") -- import lib
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ assert(b>=c)
|
|||
assert(b>d)
|
||||
assert(b>=d)
|
||||
|
||||
-- lua does not support += operators: skiping
|
||||
-- lua does not support += operators: skipping
|
||||
|
||||
-- test +
|
||||
f=Op(1)
|
||||
|
|
@ -50,7 +50,7 @@ assert(f/g==Op(1))
|
|||
|
||||
--lua 5.0.2 defines that unary - is __unm(self,nil)
|
||||
--lua 5.1.2 defines that unary - is __unm(self,self)
|
||||
--C++ expectes unary - as operator-()
|
||||
--C++ expects unary - as operator-()
|
||||
--however the latest version of SWIG strictly checks the number of args
|
||||
--and will complain if too many args are provided
|
||||
--therefore disabling these tests for now
|
||||
|
|
@ -79,7 +79,7 @@ assert(tostring(Op(1))=="Op(1)")
|
|||
assert(tostring(Op(-3))=="Op(-3)")
|
||||
|
||||
|
||||
-- check that operator overloads are correctly propogated down inheritance hierarchy
|
||||
-- check that operator overloads are correctly propagated down inheritance hierarchy
|
||||
|
||||
a_d=OpDerived()
|
||||
b_d=OpDerived(5)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = mzscheme
|
||||
MZSCHEME = mzscheme
|
||||
SCRIPTSUFFIX = _runme.scm
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -36,8 +37,8 @@ include $(srcdir)/../common.mk
|
|||
# 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) $(MZSCHEME) -r $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(MZSCHEME) -r $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean
|
||||
|
|
@ -45,4 +46,4 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile mzscheme_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" mzscheme_clean
|
||||
|
|
|
|||
102
Examples/test-suite/nested_extend_c.i
Normal file
102
Examples/test-suite/nested_extend_c.i
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
%module nested_extend_c
|
||||
|
||||
#if !defined(SWIGOCTAVE) && !defined(SWIG_JAVASCRIPT_V8)
|
||||
%extend hiA {
|
||||
hiA() {
|
||||
union hiA *self = (union hiA *)malloc(sizeof(union hiA));
|
||||
self->c = 'h';
|
||||
return self;
|
||||
}
|
||||
char hi_extend() {
|
||||
return $self->c;
|
||||
}
|
||||
static const long swig_size = sizeof(union hiA);
|
||||
}
|
||||
%extend lowA {
|
||||
lowA() {
|
||||
struct lowA *self = (struct lowA *)malloc(sizeof(struct lowA));
|
||||
self->name = 0;
|
||||
self->num = 99;
|
||||
return self;
|
||||
}
|
||||
int low_extend() {
|
||||
return $self->num;
|
||||
}
|
||||
static const long swig_size = sizeof(struct lowA);
|
||||
}
|
||||
|
||||
%extend hiB {
|
||||
hiB() {
|
||||
union hiB *self = (union hiB *)malloc(sizeof(union hiB));
|
||||
self->c = 'h';
|
||||
return self;
|
||||
}
|
||||
char hi_extend() {
|
||||
return $self->c;
|
||||
}
|
||||
static const long swig_size = sizeof(union hiB);
|
||||
}
|
||||
%extend lowB {
|
||||
lowB() {
|
||||
struct lowB *self = (struct lowB *)malloc(sizeof(struct lowB));
|
||||
self->name = 0;
|
||||
self->num = 99;
|
||||
return self;
|
||||
}
|
||||
int low_extend() {
|
||||
return $self->num;
|
||||
}
|
||||
static const long swig_size = sizeof(struct lowB);
|
||||
}
|
||||
|
||||
%extend FOO_bar {
|
||||
void bar_extend() {
|
||||
$self->d = 1;
|
||||
}
|
||||
};
|
||||
%extend NestedA {
|
||||
static const long swig_size = sizeof(struct NestedA);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
%inline %{
|
||||
typedef struct NestedA {
|
||||
int a;
|
||||
union hiA {
|
||||
char c;
|
||||
int d;
|
||||
} hiA_instance;
|
||||
|
||||
struct lowA {
|
||||
char *name;
|
||||
int num;
|
||||
} lowA_instance;
|
||||
} NestedA;
|
||||
|
||||
typedef struct {
|
||||
int a;
|
||||
union hiB {
|
||||
char c;
|
||||
int d;
|
||||
} hiB_instance;
|
||||
|
||||
struct lowB {
|
||||
char *name;
|
||||
int num;
|
||||
} lowB_instance;
|
||||
} NestedB;
|
||||
|
||||
typedef struct {
|
||||
int a;
|
||||
union {
|
||||
char c;
|
||||
int d;
|
||||
} bar;
|
||||
} FOO;
|
||||
|
||||
struct {
|
||||
int i;
|
||||
} THING;
|
||||
%}
|
||||
|
||||
|
|
@ -6,6 +6,7 @@ LANGUAGE = ocaml
|
|||
OCAMLC = ocamlc
|
||||
VARIANT = _static
|
||||
SCRIPTSUFFIX = _runme.ml
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -13,12 +14,12 @@ top_builddir = @top_builddir@
|
|||
C_TEST_CASES =
|
||||
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) -a \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) -a \
|
||||
-f $(top_srcdir)/Examples/test-suite/$*.list ] ; then \
|
||||
$(COMPILETOOL) $(OCAMLC) -c $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
$(COMPILETOOL) $(OCAMLC) -c $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
$(COMPILETOOL) $(OCAMLC) swig.cmo -custom -g -cc '$(CXX)' -o runme `cat $(top_srcdir)/Examples/test-suite/$(*).list | sed -e 's/\(.*\)/\1_wrap.o \1.cmo/g'`&& $(RUNTOOL) ./runme; \
|
||||
elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(OCAMLC) -c $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
elif [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(COMPILETOOL) $(OCAMLC) -c $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
$(COMPILETOOL) $(OCAMLC) swig.cmo -custom -g -cc '$(CXX)' -o runme $(srcdir)/$(*).cmo $(srcdir)/$(*)_runme.cmo $(srcdir)/$(*)_wrap.o && \
|
||||
$(RUNTOOL) ./runme; \
|
||||
fi ;
|
||||
|
|
@ -80,4 +81,4 @@ include $(srcdir)/../common.mk
|
|||
@rm -f $*.ml $*.mli;
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile ocaml_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" ocaml_clean
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = octave
|
||||
OCTAVE = @OCTAVE@
|
||||
SCRIPTSUFFIX = _runme.m
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -33,7 +34,7 @@ include $(srcdir)/../common.mk
|
|||
|
||||
# Overridden variables here
|
||||
LIBS = -L.
|
||||
CSRCS = $(srcdir)/octave_empty.c
|
||||
CSRCS = octave_empty.c
|
||||
|
||||
# Custom tests - tests with additional commandline options
|
||||
# none!
|
||||
|
|
@ -57,8 +58,8 @@ CSRCS = $(srcdir)/octave_empty.c
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.m appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH OCTAVE_PATH=$(srcdir):$$OCTAVE_PATH $(RUNTOOL) $(OCTAVE) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH OCTAVE_PATH=$(srcdir):$$OCTAVE_PATH $(RUNTOOL) $(OCTAVE) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: remove the generated .m file
|
||||
|
|
@ -67,7 +68,7 @@ run_testcase = \
|
|||
@rm -f $*.m;
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile octave_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" octave_clean
|
||||
|
||||
cvsignore:
|
||||
@echo '*wrap* *.mc *.so *.dll *.exp *.lib'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
LANGUAGE = perl5
|
||||
PERL = @PERL@
|
||||
SCRIPTSUFFIX = _runme.pl
|
||||
TEST_RUNNER = run-perl-test.pl
|
||||
TEST_RUNNER = $(srcdir)/run-perl-test.pl
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -49,8 +50,8 @@ include $(srcdir)/../common.mk
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.pl appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PERL) $(TEST_RUNNER) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PERL) $(TEST_RUNNER) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: remove the generated .pm file
|
||||
|
|
@ -58,4 +59,4 @@ run_testcase = \
|
|||
@rm -f $*.pm;
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile perl5_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" perl5_clean
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
LANGUAGE = php
|
||||
SCRIPTSUFFIX = _runme.php
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -56,15 +57,21 @@ missingtests: missingcpptests missingctests
|
|||
# Runs the testcase. Tries to run testcase_runme.php, and if that's not
|
||||
# found, runs testcase.php, except for multicpptests.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL="$(RUNTOOL)" php_run; \
|
||||
elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(srcdir)/$(SCRIPTPREFIX)$*.php RUNTOOL="$(RUNTOOL)" php_run; \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) RUNTOOL="$(RUNTOOL)" php_run; \
|
||||
elif [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*.php -a ! -f $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list ]; then \
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile PHP_SCRIPT=$(SCRIPTDIR)/$(SCRIPTPREFIX)$*.php RUNTOOL="$(RUNTOOL)" php_run; \
|
||||
fi
|
||||
|
||||
# Clean: remove the generated .php file
|
||||
%.clean:
|
||||
@rm -f $*.php;
|
||||
@rm -f $*.php php_$*.h
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile php_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" php_clean
|
||||
rm -f clientdata_prop_a.php clientdata_prop_b.php php_clientdata_prop_a.h php_clientdata_prop_b.h
|
||||
rm -f import_stl_a.php import_stl_b.php php_import_stl_a.h php_import_stl_b.h
|
||||
rm -f imports_a.php imports_b.php php_imports_a.h php_imports_b.h
|
||||
rm -f mod_a.php mod_b.php php_mod_a.h php_mod_b.h
|
||||
rm -f multi_import_a.php multi_import_b.php php_multi_import_a.h php_multi_import_b.h
|
||||
rm -f packageoption_a.php packageoption_b.php packageoption_c.php php_packageoption_a.h php_packageoption_b.h php_packageoption_c.h
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
require "tests.php";
|
||||
require "director_basic.php";
|
||||
|
||||
/* Removed until runtime error is fixed, see https://github.com/swig/swig/issues/164
|
||||
// No new functions
|
||||
check::functions(array(foo_ping,foo_pong,foo_get_self,a_f,a_rg,a1_ff,myclass_method,myclass_vmethod,myclass_pmethod,myclass_cmethod,myclass_get_self,myclass_call_pmethod,myclasst_i_method));
|
||||
// No new classes
|
||||
|
|
@ -53,6 +54,7 @@ $cc->method($b);
|
|||
|
||||
check::equal($bc->x, 34, "bc failed");
|
||||
check::equal($bd->x, 16, "bd failed");
|
||||
*/
|
||||
|
||||
check::done();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = pike
|
||||
PIKE = pike
|
||||
SCRIPTSUFFIX = _runme.pike
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -36,8 +37,8 @@ include $(srcdir)/../common.mk
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.pike appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PIKE) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(PIKE) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean: remove the generated .pike file
|
||||
|
|
@ -45,4 +46,4 @@ run_testcase = \
|
|||
@rm -f $*.pike;
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile pike_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" pike_clean
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@ endif
|
|||
|
||||
LANGUAGE = python
|
||||
PYTHON = $(PYBIN)
|
||||
PEP8 = @PEP8@
|
||||
|
||||
#*_runme.py for Python 2.x, *_runme3.py for Python 3.x
|
||||
PY2SCRIPTSUFFIX = _runme.py
|
||||
PY3SCRIPTSUFFIX = _runme3.py
|
||||
PY2TO3 = 2to3 -x import
|
||||
|
||||
ifeq (,$(PY3))
|
||||
SCRIPTSUFFIX = $(PY2SCRIPTSUFFIX)
|
||||
|
|
@ -25,10 +27,6 @@ srcdir = @srcdir@
|
|||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
|
||||
PY2TO3 = 2to3 -x import
|
||||
|
||||
|
||||
CPP_TEST_CASES += \
|
||||
argcargvtest \
|
||||
callback \
|
||||
|
|
@ -102,7 +100,8 @@ BUILTIN_NOT_BROKEN = $(filter-out $(BUILTIN_BROKEN),$(NOT_BROKEN_TEST_CASES))
|
|||
builtin-check : $(BUILTIN_NOT_BROKEN)
|
||||
|
||||
# Overridden variables here
|
||||
LIBS = -L.
|
||||
SCRIPTDIR = .
|
||||
LIBS = -L.
|
||||
VALGRIND_OPT += --suppressions=pythonswig.supp
|
||||
|
||||
# Custom tests - tests with additional commandline options
|
||||
|
|
@ -113,57 +112,76 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
|
|||
+$(convert_testcase)
|
||||
$(setup)
|
||||
+$(swig_and_compile_cpp)
|
||||
$(check_pep8)
|
||||
$(run_testcase)
|
||||
|
||||
%.ctest:
|
||||
+$(convert_testcase)
|
||||
$(setup)
|
||||
+$(swig_and_compile_c)
|
||||
$(check_pep8)
|
||||
$(run_testcase)
|
||||
|
||||
%.multicpptest:
|
||||
+$(convert_testcase)
|
||||
$(setup)
|
||||
+$(swig_and_compile_multi_cpp)
|
||||
$(check_pep8_multi_cpp)
|
||||
$(run_testcase)
|
||||
|
||||
|
||||
# Call 2to3 to generate Python 3.x test from the Python 2.x's *_runme.py file
|
||||
%$(PY3SCRIPTSUFFIX): %$(PY2SCRIPTSUFFIX)
|
||||
cp $< $@
|
||||
$(PY2TO3) -w $@ >/dev/null 2>&1
|
||||
|
||||
|
||||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.py (or _runme3.py for Python 3) appended after the testcase name.
|
||||
|
||||
run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
|
||||
py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
|
||||
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
|
||||
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
|
||||
|
||||
py2_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
|
||||
py3_runme = $(srcdir)/$(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
|
||||
check_pep8 = \
|
||||
if [ -n "$(PEP8)" ]; then \
|
||||
$(PEP8) --ignore=E501,E30,W291,W391 $(SCRIPTPREFIX)$*.py;\
|
||||
fi
|
||||
|
||||
check_pep8_multi_cpp = \
|
||||
if [ -n "$(PEP8)" ]; then \
|
||||
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
|
||||
$(PEP8) --ignore=E501,E30,W291,W391 $$f.py; \
|
||||
done \
|
||||
fi
|
||||
|
||||
run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme)
|
||||
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(py_runme) ]; then \
|
||||
$(run_python);\
|
||||
fi
|
||||
|
||||
ifeq (,$(PY3))
|
||||
# No copying/conversion needed for in-source-tree Python 2 scripts
|
||||
ifeq ($(SCRIPTDIR)|$(SCRIPTSUFFIX),$(srcdir)|$(PY2SCRIPTSUFFIX))
|
||||
convert_testcase =
|
||||
else
|
||||
|
||||
convert_testcase = \
|
||||
if [ -f $(py2_runme) ]; then \
|
||||
$(MAKE) -f $(srcdir)/Makefile $(py3_runme); \
|
||||
if [ -f $(srcdir)/$(py2_runme) ]; then \
|
||||
$(MAKE) $(SCRIPTDIR)/$(py_runme); \
|
||||
fi
|
||||
|
||||
$(SCRIPTDIR)/$(SCRIPTPREFIX)%$(SCRIPTSUFFIX): $(srcdir)/$(SCRIPTPREFIX)%$(PY2SCRIPTSUFFIX)
|
||||
test x$< = x$@ || cp $< $@ || exit 1
|
||||
test x$(PY3) = x || $(PY2TO3) -w $@ >/dev/null 2>&1 || exit 1
|
||||
|
||||
endif
|
||||
|
||||
# Clean: remove the generated .py file
|
||||
# We only remove the _runme3.py if it is generated by 2to3 from a _runme.py.
|
||||
%.clean:
|
||||
@rm -f $*.py;
|
||||
@#We only remove the _runme3.py if it is generated by 2to3 from a _runme.py.
|
||||
@if [ -f $(py2_runme) ]; then rm -f $(py3_runme) $(py3_runme).bak; fi
|
||||
@rm -f $*.py
|
||||
@if test -f $(srcdir)/$(py2_runme); then rm -f $(SCRIPTDIR)/$(py3_runme) $(SCRIPTDIR)/$(py3_runme).bak; fi
|
||||
@if test "x$(SCRIPTDIR)" != "x$(srcdir)"; then rm -f $(SCRIPTDIR)/$(py2_runme); fi
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" python_clean
|
||||
rm -f hugemod.h hugemod_a.i hugemod_b.i hugemod_a.py hugemod_b.py hugemod_runme.py
|
||||
rm -f clientdata_prop_a.py clientdata_prop_b.py import_stl_a.py import_stl_b.py
|
||||
rm -f imports_a.py imports_b.py mod_a.py mod_b.py multi_import_a.py
|
||||
|
|
|
|||
104
Examples/test-suite/python/doxygen_basic_notranslate_runme.py
Executable file → Normal file
104
Examples/test-suite/python/doxygen_basic_notranslate_runme.py
Executable file → Normal file
|
|
@ -6,79 +6,79 @@ import sys
|
|||
import commentVerifier
|
||||
|
||||
commentVerifier.check(doxygen_basic_notranslate.function.__doc__,
|
||||
r"""
|
||||
\brief
|
||||
Brief description.
|
||||
r"""
|
||||
\brief
|
||||
Brief description.
|
||||
|
||||
The comment text
|
||||
\author Some author
|
||||
\return Some number
|
||||
\sa function2
|
||||
The comment text
|
||||
\author Some author
|
||||
\return Some number
|
||||
\sa function2
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_basic_notranslate.function2.__doc__,
|
||||
r"""
|
||||
A test of a very very very very very very very very very very very very very very very very
|
||||
very very very very very long comment string.
|
||||
r"""
|
||||
A test of a very very very very very very very very very very very very very very very very
|
||||
very very very very very long comment string.
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_basic_notranslate.function3.__doc__,
|
||||
r"""
|
||||
----------------------------------------------------------------
|
||||
Overload 1:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function \b one
|
||||
|
||||
----------------------------------------------------------------
|
||||
Overload 2:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function \b two
|
||||
|
||||
"""
|
||||
r"""
|
||||
----------------------------------------------------------------
|
||||
Overload 1:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function \b one
|
||||
|
||||
----------------------------------------------------------------
|
||||
Overload 2:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function \b two
|
||||
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_basic_notranslate.function4.__doc__,
|
||||
r"""
|
||||
A test of some mixed tag usage
|
||||
\if CONDITION
|
||||
This \a code fragment shows us something \.
|
||||
\par Minuses:
|
||||
\arg it's senseless
|
||||
\arg it's stupid
|
||||
\arg it's null
|
||||
r"""
|
||||
A test of some mixed tag usage
|
||||
\if CONDITION
|
||||
This \a code fragment shows us something \.
|
||||
\par Minuses:
|
||||
\arg it's senseless
|
||||
\arg it's stupid
|
||||
\arg it's null
|
||||
|
||||
\warning This may not work as expected
|
||||
\warning This may not work as expected
|
||||
|
||||
\code
|
||||
int main() { while(true); }
|
||||
\endcode
|
||||
\endif
|
||||
\code
|
||||
int main() { while(true); }
|
||||
\endcode
|
||||
\endif
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_notranslate.function5.__doc__,
|
||||
r"""
|
||||
This is a post comment.
|
||||
"""
|
||||
r"""
|
||||
This is a post comment.
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_notranslate.function6.__doc__,
|
||||
r"""
|
||||
Test for default args
|
||||
@param a Some parameter, default is 42
|
||||
r"""
|
||||
Test for default args
|
||||
@param a Some parameter, default is 42
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_notranslate.function7.__doc__,
|
||||
r"""
|
||||
Test for a parameter with difficult type
|
||||
(mostly for python)
|
||||
@param a Very strange param
|
||||
r"""
|
||||
Test for a parameter with difficult type
|
||||
(mostly for python)
|
||||
@param a Very strange param
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
|
|
|
|||
98
Examples/test-suite/python/doxygen_basic_translate_runme.py
Executable file → Normal file
98
Examples/test-suite/python/doxygen_basic_translate_runme.py
Executable file → Normal file
|
|
@ -6,74 +6,74 @@ import sys
|
|||
import commentVerifier
|
||||
|
||||
commentVerifier.check(doxygen_basic_translate.function.__doc__,
|
||||
"""
|
||||
Brief description.
|
||||
"""
|
||||
Brief description.
|
||||
|
||||
The comment text.
|
||||
The comment text.
|
||||
|
||||
Author: Some author
|
||||
Author: Some author
|
||||
|
||||
Return: Some number
|
||||
Return: Some number
|
||||
|
||||
See also: function2
|
||||
"""
|
||||
See also: function2
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function2.__doc__,
|
||||
"""
|
||||
A test of a very very very very very very very very very very very very very very very very
|
||||
very very very very very long comment string.
|
||||
"""
|
||||
"""
|
||||
A test of a very very very very very very very very very very very very very very very very
|
||||
very very very very very long comment string.
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function3.__doc__,
|
||||
"""
|
||||
----------------------------------------------------------------
|
||||
Overload 1:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function __one__
|
||||
"""
|
||||
----------------------------------------------------------------
|
||||
Overload 1:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function __one__
|
||||
|
||||
----------------------------------------------------------------
|
||||
Overload 2:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function __two__
|
||||
----------------------------------------------------------------
|
||||
Overload 2:
|
||||
----------------------------------------------------------------
|
||||
A test for overloaded functions
|
||||
This is function __two__
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function4.__doc__,
|
||||
"""
|
||||
A test of some mixed tag usage
|
||||
If: CONDITION {
|
||||
This _code_ fragment shows us something .
|
||||
Title: Minuses:
|
||||
-it\'s senseless
|
||||
-it\'s stupid
|
||||
-it\'s null
|
||||
"""
|
||||
A test of some mixed tag usage
|
||||
If: CONDITION {
|
||||
This _code_ fragment shows us something .
|
||||
Title: Minuses:
|
||||
-it\'s senseless
|
||||
-it\'s stupid
|
||||
-it\'s null
|
||||
|
||||
Warning: This may not work as expected
|
||||
Warning: This may not work as expected
|
||||
|
||||
int main() { while(true); }
|
||||
int main() { while(true); }
|
||||
|
||||
}
|
||||
"""
|
||||
}
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function5.__doc__,
|
||||
"""
|
||||
This is a post comment.
|
||||
"""
|
||||
"""
|
||||
This is a post comment.
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function6.__doc__,
|
||||
"""
|
||||
Test for default args
|
||||
Arguments:
|
||||
a (int) -- Some parameter, default is 42
|
||||
"""
|
||||
"""
|
||||
Test for default args
|
||||
Arguments:
|
||||
a (int) -- Some parameter, default is 42
|
||||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_basic_translate.function7.__doc__,
|
||||
"""
|
||||
Test for a parameter with difficult type
|
||||
(mostly for python)
|
||||
Arguments:
|
||||
a (Shape::superType *[10]) -- Very strange param
|
||||
"""
|
||||
"""
|
||||
Test for a parameter with difficult type
|
||||
(mostly for python)
|
||||
Arguments:
|
||||
a (Shape::superType *[10]) -- Very strange param
|
||||
"""
|
||||
)
|
||||
|
|
|
|||
138
Examples/test-suite/python/doxygen_misc_constructs_runme.py
Executable file → Normal file
138
Examples/test-suite/python/doxygen_misc_constructs_runme.py
Executable file → Normal file
|
|
@ -7,17 +7,17 @@ import commentVerifier
|
|||
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.getAddress.__doc__,
|
||||
r"""
|
||||
Returns address of file line.
|
||||
r"""
|
||||
Returns address of file line.
|
||||
|
||||
Arguments:
|
||||
fileName (int &) -- name of the file, where the source line is located
|
||||
line (int) -- line number
|
||||
isGetSize (bool) -- if set, for every object location both address and size are returned
|
||||
Arguments:
|
||||
fileName (int &) -- name of the file, where the source line is located
|
||||
line (int) -- line number
|
||||
isGetSize (bool) -- if set, for every object location both address and size are returned
|
||||
|
||||
Connection::getId()
|
||||
Connection::getId()
|
||||
|
||||
""")
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.CConnectionConfig.__doc__,
|
||||
r"""
|
||||
|
|
@ -38,107 +38,107 @@ commentVerifier.check(doxygen_misc_constructs.CConnectionConfig.__doc__,
|
|||
""")
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.waitTime.__doc__,
|
||||
r"""
|
||||
Determines how long the 'isystem.connect' should wait for running
|
||||
instances to respond. Only one of 'lfWaitXXX' flags from IConnect::ELaunchFlags
|
||||
may be specified.
|
||||
"""
|
||||
r"""
|
||||
Determines how long the 'isystem.connect' should wait for running
|
||||
instances to respond. Only one of 'lfWaitXXX' flags from IConnect::ELaunchFlags
|
||||
may be specified.
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.getConnection.__doc__,
|
||||
r"""
|
||||
This function returns connection id.
|
||||
"""
|
||||
r"""
|
||||
This function returns connection id.
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.getFirstLetter.__doc__,
|
||||
r''
|
||||
r''
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.ClassWithNestedEnum.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
Class description.
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.isNoSpaceValidA.__doc__,
|
||||
r"""
|
||||
This comment without space after '*' is valid in Doxygen.
|
||||
r"""
|
||||
This comment without space after '*' is valid in Doxygen.
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.isNoSpaceValidB.__doc__,
|
||||
r"""
|
||||
.This comment without space after '*' is valid in Doxygen.
|
||||
r"""
|
||||
.This comment without space after '*' is valid in Doxygen.
|
||||
|
||||
"""
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.isNoSpaceValidC.__doc__,
|
||||
r''
|
||||
r''
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.backslashA.__doc__,
|
||||
r"""
|
||||
Backslash following'word' is a valid doxygen command. Output contains
|
||||
'followingword' with 'word' in code font.
|
||||
"""
|
||||
r"""
|
||||
Backslash following'word' is a valid doxygen command. Output contains
|
||||
'followingword' with 'word' in code font.
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.backslashB.__doc__,
|
||||
r"""
|
||||
Doxy command without trailing space is ignored - nothing appears
|
||||
on output. Standalone \ and '\' get to output.
|
||||
Standalone @ and '@' get to output.
|
||||
Commands "in quoted \b strings are treated as plain text".
|
||||
Commands not recognized by Doxygen are ignored.
|
||||
Backslashes in DOS paths d:and words
|
||||
following them do not appear on output, we must quote them with
|
||||
double quotes: "d:\xyz\qwe\myfile", "@something". Single quotes do not help:
|
||||
'd:'. Escaping works: d:\xyz\qwe\myfile. Unix
|
||||
paths of course have no such problems: /xyz/qwe/myfile
|
||||
Commands for escaped symbols:
|
||||
$ @ \ & ~ < > # % " . :: @text ::text
|
||||
"""
|
||||
r"""
|
||||
Doxy command without trailing space is ignored - nothing appears
|
||||
on output. Standalone \ and '\' get to output.
|
||||
Standalone @ and '@' get to output.
|
||||
Commands "in quoted \b strings are treated as plain text".
|
||||
Commands not recognized by Doxygen are ignored.
|
||||
Backslashes in DOS paths d:and words
|
||||
following them do not appear on output, we must quote them with
|
||||
double quotes: "d:\xyz\qwe\myfile", "@something". Single quotes do not help:
|
||||
'd:'. Escaping works: d:\xyz\qwe\myfile. Unix
|
||||
paths of course have no such problems: /xyz/qwe/myfile
|
||||
Commands for escaped symbols:
|
||||
$ @ \ & ~ < > # % " . :: @text ::text
|
||||
"""
|
||||
)
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.backslashC.__doc__,
|
||||
r"""
|
||||
Backslash e at end of _line_ froze SWIG
|
||||
_with_ old comment parser.
|
||||
r"""
|
||||
Backslash e at end of _line_ froze SWIG
|
||||
_with_ old comment parser.
|
||||
|
||||
See also: MyClass::fun(char,
|
||||
float)
|
||||
"""
|
||||
See also: MyClass::fun(char,
|
||||
float)
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
commentVerifier.check(doxygen_misc_constructs.cycle.__doc__,
|
||||
r"""
|
||||
The next line contains expression:
|
||||
r"""
|
||||
The next line contains expression:
|
||||
|
||||
['retVal < 10', 'g_counter == 23 && g_mode & 3']
|
||||
['retVal < 10', 'g_counter == 23 && g_mode & 3']
|
||||
|
||||
|
||||
Both words should be emphasized __isystem.connect__.
|
||||
But not the last period. For __example__, comma should not be emphasized.
|
||||
Similar __for__: double colon.
|
||||
Both words should be emphasized __isystem.connect__.
|
||||
But not the last period. For __example__, comma should not be emphasized.
|
||||
Similar __for__: double colon.
|
||||
|
||||
Spaces at the start of line should be taken into account:
|
||||
Arguments:
|
||||
id (int) -- used as prefix in log
|
||||
statements. The default value is empty string, which is OK if
|
||||
there is only one app. instance. Example:
|
||||
|
||||
ctrl.setBP("func1");
|
||||
|
||||
If we set the id to 'main_', we get:
|
||||
|
||||
main_ctrl.setBP("func1");
|
||||
|
||||
Spaces at the start of line should be taken into account:
|
||||
Arguments:
|
||||
id (int) -- used as prefix in log
|
||||
statements. The default value is empty string, which is OK if
|
||||
there is only one app. instance. Example:
|
||||
|
||||
ctrl.setBP("func1");
|
||||
|
||||
If we set the id to 'main_', we get:
|
||||
|
||||
main_ctrl.setBP("func1");
|
||||
|
||||
|
||||
fileName (char *) -- name of the log file
|
||||
"""
|
||||
fileName (char *) -- name of the log file
|
||||
"""
|
||||
);
|
||||
|
|
|
|||
22
Examples/test-suite/python/doxygen_parsing_runme.py
Executable file → Normal file
22
Examples/test-suite/python/doxygen_parsing_runme.py
Executable file → Normal file
|
|
@ -6,25 +6,25 @@ import sys
|
|||
import commentVerifier
|
||||
|
||||
commentVerifier.check(doxygen_parsing.someFunction.__doc__,
|
||||
r"""
|
||||
The function comment
|
||||
""")
|
||||
r"""
|
||||
The function comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeClass.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The class comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeStruct.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The struct comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethod.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The class method comment.
|
||||
|
||||
SomeAnotherClass#classMethodExtended(int, int) a link text
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethodExtended.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The class method with parameter
|
||||
|
||||
Arguments:
|
||||
|
|
@ -33,7 +33,7 @@ r"""
|
|||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherClass.classMethodExtended2.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The class method with parameter
|
||||
|
||||
Arguments:
|
||||
|
|
@ -42,11 +42,11 @@ r"""
|
|||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethod.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The struct method comment
|
||||
""")
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethodExtended.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The struct method with parameter
|
||||
|
||||
Arguments:
|
||||
|
|
@ -55,7 +55,7 @@ r"""
|
|||
"""
|
||||
)
|
||||
commentVerifier.check(doxygen_parsing.SomeAnotherStruct.structMethodExtended2.__doc__,
|
||||
r"""
|
||||
r"""
|
||||
The struct method with parameter
|
||||
|
||||
Arguments:
|
||||
|
|
|
|||
214
Examples/test-suite/python/doxygen_translate_all_tags_runme.py
Executable file → Normal file
214
Examples/test-suite/python/doxygen_translate_all_tags_runme.py
Executable file → Normal file
|
|
@ -8,42 +8,42 @@ import commentVerifier
|
|||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func01.__doc__,
|
||||
r"""
|
||||
_Hello_
|
||||
_Hello_
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-some list item
|
||||
-some list item
|
||||
|
||||
This is attention!
|
||||
You were warned!
|
||||
This is attention!
|
||||
You were warned!
|
||||
|
||||
Authors: lots of them
|
||||
Author: Zubr
|
||||
Authors: lots of them
|
||||
Author: Zubr
|
||||
|
||||
__boldword__
|
||||
__boldword__
|
||||
|
||||
Some brief description,
|
||||
extended to many lines.
|
||||
Some brief description,
|
||||
extended to many lines.
|
||||
|
||||
Not everything works right now...
|
||||
'codeword'
|
||||
Not everything works right now...
|
||||
'codeword'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'citationword'
|
||||
'citationword'
|
||||
|
||||
some test code
|
||||
""")
|
||||
some test code
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func02.__doc__,
|
||||
r"""
|
||||
Conditional comment: SOMECONDITION
|
||||
Some conditional comment
|
||||
End of conditional comment.
|
||||
Conditional comment: SOMECONDITION
|
||||
Some conditional comment
|
||||
End of conditional comment.
|
||||
|
||||
|
||||
|
||||
|
|
@ -51,23 +51,23 @@ r"""
|
|||
|
||||
|
||||
|
||||
Copyright: some copyright
|
||||
Copyright: some copyright
|
||||
|
||||
1970 - 2012
|
||||
1970 - 2012
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Deprecated: Now use another function
|
||||
Deprecated: Now use another function
|
||||
|
||||
This is very large
|
||||
and detailed description of some thing
|
||||
""")
|
||||
This is very large
|
||||
and detailed description of some thing
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func03.__doc__,
|
||||
r"""
|
||||
Comment for __func03()__.
|
||||
Comment for __func03()__.
|
||||
|
||||
|
||||
|
||||
|
|
@ -77,30 +77,30 @@ r"""
|
|||
|
||||
|
||||
|
||||
_italicword_
|
||||
_italicword_
|
||||
|
||||
emphazedWord
|
||||
emphazedWord
|
||||
|
||||
|
||||
|
||||
Example: someFile.txt
|
||||
Some details on using the example
|
||||
""")
|
||||
Example: someFile.txt
|
||||
Some details on using the example
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func04.__doc__,
|
||||
r"""
|
||||
Throws: SuperError
|
||||
Throws: SuperError
|
||||
|
||||
|
||||
|
||||
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||
|
||||
|
||||
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||
|
||||
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||
|
||||
|
||||
|
||||
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||
|
||||
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
|
||||
|
||||
|
||||
|
||||
|
|
@ -113,31 +113,31 @@ r"""
|
|||
|
||||
|
||||
|
||||
This will only appear in hmtl
|
||||
This will only appear in hmtl
|
||||
|
||||
""")
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func05.__doc__,
|
||||
r"""
|
||||
If: ANOTHERCONDITION {
|
||||
First part of comment
|
||||
If: SECONDCONDITION {
|
||||
Nested condition text
|
||||
}Else if: THIRDCONDITION {
|
||||
The third condition text
|
||||
}Else: { The last text block
|
||||
If: ANOTHERCONDITION {
|
||||
First part of comment
|
||||
If: SECONDCONDITION {
|
||||
Nested condition text
|
||||
}Else if: THIRDCONDITION {
|
||||
The third condition text
|
||||
}Else: { The last text block
|
||||
}
|
||||
}Else: { Second part of comment
|
||||
If: CONDITION {
|
||||
Second part extended
|
||||
}
|
||||
}
|
||||
}Else: { Second part of comment
|
||||
If: CONDITION {
|
||||
Second part extended
|
||||
|
||||
If not: SOMECONDITION {
|
||||
This is printed if not
|
||||
}
|
||||
}
|
||||
|
||||
If not: SOMECONDITION {
|
||||
This is printed if not
|
||||
}
|
||||
|
||||
Image: testImage.bmp("Hello, world!")
|
||||
Image: testImage.bmp("Hello, world!")
|
||||
|
||||
|
||||
|
||||
|
|
@ -149,35 +149,35 @@ r"""
|
|||
|
||||
|
||||
|
||||
Some text
|
||||
describing invariant.
|
||||
""")
|
||||
Some text
|
||||
describing invariant.
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func06.__doc__,
|
||||
r"""
|
||||
Comment for __func06()__.
|
||||
Comment for __func06()__.
|
||||
|
||||
|
||||
|
||||
|
||||
This will only appear in LATeX
|
||||
This will only appear in LATeX
|
||||
|
||||
|
||||
|
||||
|
||||
-Some unordered list
|
||||
-With lots of items
|
||||
-lots of lots of items
|
||||
-Some unordered list
|
||||
-With lots of items
|
||||
-lots of lots of items
|
||||
|
||||
|
||||
|
||||
|
||||
someMember Some description follows
|
||||
someMember Some description follows
|
||||
|
||||
|
||||
|
||||
|
||||
This will only appear in man
|
||||
This will only appear in man
|
||||
|
||||
|
||||
|
||||
|
|
@ -190,58 +190,58 @@ r"""
|
|||
|
||||
|
||||
|
||||
""")
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func07.__doc__,
|
||||
r"""
|
||||
Comment for __func07()__.
|
||||
Comment for __func07()__.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Notes: Here
|
||||
is the note!
|
||||
Notes: Here
|
||||
is the note!
|
||||
|
||||
This is an overloaded member function, provided for convenience.
|
||||
It differs from the above function only in what argument(s) it accepts.
|
||||
This is an overloaded member function, provided for convenience.
|
||||
It differs from the above function only in what argument(s) it accepts.
|
||||
|
||||
someword
|
||||
someword
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Title: The paragraph title
|
||||
The paragraph text.
|
||||
Maybe even multiline
|
||||
Title: The paragraph title
|
||||
The paragraph text.
|
||||
Maybe even multiline
|
||||
|
||||
|
||||
|
||||
Arguments:
|
||||
a (int) -- the first param
|
||||
Arguments:
|
||||
a (int) -- the first param
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
""")
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func08.__doc__,
|
||||
r"""
|
||||
Text after anchor.
|
||||
Text after anchor.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Anchor description'
|
||||
'Anchor description'
|
||||
|
||||
'someAnchor' not quoted text is not part of ref tag
|
||||
'someAnchor' not quoted text is not part of ref tag
|
||||
|
||||
'someAnchor'
|
||||
'someAnchor'
|
||||
|
||||
|
||||
|
||||
|
|
@ -251,35 +251,35 @@ r"""
|
|||
|
||||
|
||||
|
||||
Remarks: Some remark text
|
||||
Remarks: Some remark text
|
||||
|
||||
Another remarks section
|
||||
Another remarks section
|
||||
|
||||
Return: Whatever
|
||||
Return: Whatever
|
||||
|
||||
it
|
||||
it
|
||||
|
||||
Returns: may return
|
||||
Returns: may return
|
||||
|
||||
""")
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func09.__doc__,
|
||||
r"""
|
||||
This will only appear in RTF
|
||||
This will only appear in RTF
|
||||
|
||||
|
||||
See also: someOtherMethod
|
||||
See also: someOtherMethod
|
||||
|
||||
|
||||
|
||||
See also: function
|
||||
See also: function
|
||||
|
||||
Same as
|
||||
brief description
|
||||
Same as
|
||||
brief description
|
||||
|
||||
|
||||
|
||||
Since: version 0.0.0.1
|
||||
Since: version 0.0.0.1
|
||||
|
||||
|
||||
|
||||
|
|
@ -295,17 +295,17 @@ r"""
|
|||
|
||||
|
||||
|
||||
Throw: superException
|
||||
Throw: superException
|
||||
|
||||
Throws: RuntimeError
|
||||
""")
|
||||
Throws: RuntimeError
|
||||
""")
|
||||
|
||||
commentVerifier.check(doxygen_translate_all_tags.func10.__doc__,
|
||||
r"""
|
||||
TODO: Some very important task
|
||||
TODO: Some very important task
|
||||
|
||||
Arguments:
|
||||
b (float) -- B is mentioned again...
|
||||
Arguments:
|
||||
b (float) -- B is mentioned again...
|
||||
|
||||
|
||||
|
||||
|
|
@ -313,24 +313,24 @@ r"""
|
|||
|
||||
|
||||
|
||||
very long
|
||||
text with tags <sometag>
|
||||
very long
|
||||
text with tags <sometag>
|
||||
|
||||
|
||||
|
||||
|
||||
Version: 0.0.0.2
|
||||
Version: 0.0.0.2
|
||||
|
||||
Warning: This is senseless!
|
||||
Warning: This is senseless!
|
||||
|
||||
|
||||
|
||||
|
||||
This will only appear in XML
|
||||
This will only appear in XML
|
||||
|
||||
|
||||
Here goes test of symbols:
|
||||
$ @ \ & ~ < > # % " . ::
|
||||
Here goes test of symbols:
|
||||
$ @ \ & ~ < > # % " . ::
|
||||
|
||||
And here goes simple text
|
||||
""")
|
||||
And here goes simple text
|
||||
""")
|
||||
|
|
|
|||
|
|
@ -8,35 +8,35 @@ import commentVerifier
|
|||
|
||||
commentVerifier.check(doxygen_translate_links.function.__doc__,
|
||||
r"""
|
||||
Testing typenames converting in @ link
|
||||
Testing typenames converting in @ link
|
||||
|
||||
superFunc(int,std::string)
|
||||
Test for std_string member
|
||||
superFunc(int,std::string)
|
||||
Test for std_string member
|
||||
|
||||
|
||||
superFunc(int,long,void*)
|
||||
Test for simple types
|
||||
superFunc(int,long,void*)
|
||||
Test for simple types
|
||||
|
||||
|
||||
superFunc(Shape::superType*)
|
||||
Test for custom types
|
||||
superFunc(Shape::superType*)
|
||||
Test for custom types
|
||||
|
||||
|
||||
superFunc(int**[13])
|
||||
Test for complex types
|
||||
superFunc(int**[13])
|
||||
Test for complex types
|
||||
|
||||
|
||||
same works for 'See also:' links:
|
||||
same works for 'See also:' links:
|
||||
|
||||
See also: superFunc(int,std::string)
|
||||
See also: superFunc(int,long,void*)
|
||||
See also: superFunc(Shape::superType*)
|
||||
See also: superFunc(int**[13])
|
||||
See also: superFunc(int,std::string)
|
||||
See also: superFunc(int,long,void*)
|
||||
See also: superFunc(Shape::superType*)
|
||||
See also: superFunc(int**[13])
|
||||
|
||||
some failing params:
|
||||
some failing params:
|
||||
|
||||
See also: superFunc()
|
||||
See also: superFunc()
|
||||
See also: superFunc()
|
||||
See also: superFunc()
|
||||
See also: superFunc()
|
||||
See also: superFunc()
|
||||
|
||||
""")
|
||||
""")
|
||||
|
|
|
|||
302
Examples/test-suite/python/doxygen_translate_runme.py
Executable file → Normal file
302
Examples/test-suite/python/doxygen_translate_runme.py
Executable file → Normal file
|
|
@ -8,260 +8,260 @@ import commentVerifier
|
|||
|
||||
commentVerifier.check(doxygen_translate.function.__doc__,
|
||||
r"""
|
||||
_Hello_
|
||||
_Hello_
|
||||
|
||||
-some list item
|
||||
-some list item
|
||||
|
||||
Authors: lots of them
|
||||
Authors: lots of them
|
||||
|
||||
Author: Zubr
|
||||
Author: Zubr
|
||||
|
||||
__boldword__
|
||||
__boldword__
|
||||
|
||||
'codeword'
|
||||
'codeword'
|
||||
|
||||
'citationword'
|
||||
'citationword'
|
||||
|
||||
some test code
|
||||
some test code
|
||||
|
||||
Conditional comment: SOMECONDITION
|
||||
Some conditional comment
|
||||
End of conditional comment.
|
||||
Conditional comment: SOMECONDITION
|
||||
Some conditional comment
|
||||
End of conditional comment.
|
||||
|
||||
Copyright: some copyright
|
||||
Copyright: some copyright
|
||||
|
||||
Deprecated: Now use another function
|
||||
Deprecated: Now use another function
|
||||
|
||||
_italicword_
|
||||
_italicword_
|
||||
|
||||
Example: someFile.txt
|
||||
Some details on using the example
|
||||
Example: someFile.txt
|
||||
Some details on using the example
|
||||
|
||||
Throws: SuperError
|
||||
Throws: SuperError
|
||||
|
||||
If: ANOTHERCONDITION {
|
||||
First part of comment
|
||||
If: SECONDCONDITION {
|
||||
Nested condition text
|
||||
}Else if: THIRDCONDITION {
|
||||
The third condition text
|
||||
}Else: { The last text block
|
||||
If: ANOTHERCONDITION {
|
||||
First part of comment
|
||||
If: SECONDCONDITION {
|
||||
Nested condition text
|
||||
}Else if: THIRDCONDITION {
|
||||
The third condition text
|
||||
}Else: { The last text block
|
||||
}
|
||||
}Else: { Second part of comment
|
||||
If: CONDITION {
|
||||
Second part extended
|
||||
}
|
||||
}
|
||||
}Else: { Second part of comment
|
||||
If: CONDITION {
|
||||
Second part extended
|
||||
|
||||
If not: SOMECONDITION {
|
||||
This is printed if not
|
||||
}
|
||||
}
|
||||
|
||||
If not: SOMECONDITION {
|
||||
This is printed if not
|
||||
}
|
||||
|
||||
Image: testImage.bmp("Hello, world!")
|
||||
Image: testImage.bmp("Hello, world!")
|
||||
|
||||
|
||||
|
||||
-Some unordered list
|
||||
-With lots of items
|
||||
-lots of lots of items
|
||||
-Some unordered list
|
||||
-With lots of items
|
||||
-lots of lots of items
|
||||
|
||||
|
||||
|
||||
someMember Some description follows
|
||||
someMember Some description follows
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Notes: Here
|
||||
is the note!
|
||||
Notes: Here
|
||||
is the note!
|
||||
|
||||
This is an overloaded member function, provided for convenience.
|
||||
It differs from the above function only in what argument(s) it accepts.
|
||||
This is an overloaded member function, provided for convenience.
|
||||
It differs from the above function only in what argument(s) it accepts.
|
||||
|
||||
someword
|
||||
someword
|
||||
|
||||
|
||||
|
||||
Title: The paragraph title
|
||||
The paragraph text.
|
||||
Maybe even multiline
|
||||
Title: The paragraph title
|
||||
The paragraph text.
|
||||
Maybe even multiline
|
||||
|
||||
Arguments:
|
||||
a (int) -- the first param
|
||||
Arguments:
|
||||
a (int) -- the first param
|
||||
|
||||
Remarks: Some remark text
|
||||
Remarks: Some remark text
|
||||
|
||||
Another remarks section
|
||||
Another remarks section
|
||||
|
||||
Return: Whatever
|
||||
Return: Whatever
|
||||
|
||||
it
|
||||
it
|
||||
|
||||
Returns: may return
|
||||
Returns: may return
|
||||
|
||||
See also: someOtherMethod
|
||||
See also: someOtherMethod
|
||||
|
||||
See also: function
|
||||
See also: function
|
||||
|
||||
Since: version 0.0.0.1
|
||||
Since: version 0.0.0.1
|
||||
|
||||
Throw: superException
|
||||
Throw: superException
|
||||
|
||||
Throws: RuntimeError
|
||||
Throws: RuntimeError
|
||||
|
||||
TODO: Some very important task
|
||||
TODO: Some very important task
|
||||
|
||||
Arguments:
|
||||
b (float) -- B is mentioned again...
|
||||
Arguments:
|
||||
b (float) -- B is mentioned again...
|
||||
|
||||
|
||||
very long
|
||||
text with tags <sometag>
|
||||
very long
|
||||
text with tags <sometag>
|
||||
|
||||
|
||||
Version: 0.0.0.2
|
||||
Version: 0.0.0.2
|
||||
|
||||
Warning: This is senseless!
|
||||
Warning: This is senseless!
|
||||
|
||||
Here goes test of symbols:
|
||||
$ @ \ & ~ < > # % " . ::
|
||||
Here goes test of symbols:
|
||||
$ @ \ & ~ < > # % " . ::
|
||||
|
||||
And here goes simple text
|
||||
"""
|
||||
And here goes simple text
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
|
||||
commentVerifier.check(doxygen_translate.htmlFunction.__doc__,
|
||||
r"""
|
||||
Test for html tags. See Doxygen doc for list of tags recognized by Doxygen.
|
||||
Test for html tags. See Doxygen doc for list of tags recognized by Doxygen.
|
||||
|
||||
This is link ("http://acme.com/index.html")
|
||||
__bold__
|
||||
Quote:
|
||||
Quotation block.
|
||||
("http://www.worldwildlife.org/who/index.html")
|
||||
This is link ("http://acme.com/index.html")
|
||||
__bold__
|
||||
Quote:
|
||||
Quotation block.
|
||||
("http://www.worldwildlife.org/who/index.html")
|
||||
|
||||
|
||||
center
|
||||
'this is code'
|
||||
center
|
||||
'this is code'
|
||||
|
||||
|
||||
Starts an item title.
|
||||
Starts an item description.
|
||||
Starts an item title.
|
||||
Starts an item description.
|
||||
|
||||
|
||||
Starts a piece of text displayed in a typewriter font.
|
||||
Starts a piece of text displayed in a typewriter font.
|
||||
|
||||
Starts a section with a specific style (HTML only)
|
||||
Starts a section with a specific style (HTML only)
|
||||
|
||||
__Starts a piece of text displayed in an italic font.__
|
||||
__Starts a piece of text displayed in an italic font.__
|
||||
|
||||
'Form' does not generate any output.
|
||||
'Form' does not generate any output.
|
||||
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
|
||||
# Heading 1
|
||||
# Heading 1
|
||||
|
||||
## Heading 2
|
||||
## Heading 2
|
||||
|
||||
### Heading 3
|
||||
### Heading 3
|
||||
|
||||
_Starts a piece of text displayed in an italic font._
|
||||
Input tag.
|
||||
Image: src="slika.png"
|
||||
Meta tag.
|
||||
Multicol is ignored by doxygen.
|
||||
_Starts a piece of text displayed in an italic font._
|
||||
Input tag.
|
||||
Image: src="slika.png"
|
||||
Meta tag.
|
||||
Multicol is ignored by doxygen.
|
||||
|
||||
|
||||
|
||||
- List item 1.
|
||||
- List item 2.
|
||||
- List item 1.
|
||||
- List item 2.
|
||||
|
||||
|
||||
|
||||
Starts a new paragraph.
|
||||
Starts a new paragraph.
|
||||
|
||||
Starts a preformatted fragment.
|
||||
Starts a preformatted fragment.
|
||||
|
||||
Starts a section of text displayed in a smaller font.
|
||||
Starts a section of text displayed in a smaller font.
|
||||
|
||||
'Starts an inline text fragment with a specific style.'
|
||||
__Starts a section of bold text.__
|
||||
Starts a piece of text displayed in subscript.
|
||||
Starts a piece of text displayed in superscript.
|
||||
'Starts an inline text fragment with a specific style.'
|
||||
__Starts a section of bold text.__
|
||||
Starts a piece of text displayed in subscript.
|
||||
Starts a piece of text displayed in superscript.
|
||||
|
||||
|
||||
Animals
|
||||
| Column 1 | Column 2 |
|
||||
-----------------------
|
||||
| cow | dog |
|
||||
| cat | mouse |
|
||||
| horse | parrot |
|
||||
Animals
|
||||
| Column 1 | Column 2 |
|
||||
-----------------------
|
||||
| cow | dog |
|
||||
| cat | mouse |
|
||||
| horse | parrot |
|
||||
|
||||
|
||||
Starts a piece of text displayed in a typewriter font.
|
||||
Starts a piece of text displayed in a typewriter font.
|
||||
|
||||
Starts a piece of text displayed in a typewriter font.
|
||||
Starts a piece of text displayed in a typewriter font.
|
||||
|
||||
|
||||
|
||||
- List item 1.
|
||||
- List item 2.
|
||||
- List item 3.
|
||||
- List item 1.
|
||||
- List item 2.
|
||||
- List item 3.
|
||||
|
||||
|
||||
_Starts a piece of text displayed in an italic font._
|
||||
_Starts a piece of text displayed in an italic font._
|
||||
|
||||
|
||||
<u>underlined \b bold text - doxy commands are ignored inside 'htmlonly' section </u>
|
||||
<u>underlined \b bold text - doxy commands are ignored inside 'htmlonly' section </u>
|
||||
|
||||
""")
|
||||
""")
|
||||
|
||||
|
||||
commentVerifier.check(doxygen_translate.htmlTableFunction.__doc__,
|
||||
r"""
|
||||
The meaning of flags:
|
||||
The meaning of flags:
|
||||
|
||||
Arguments:
|
||||
byFlags (int) -- bits marking required items:
|
||||
|
||||
| Size in bits| Items Required |
|
||||
--------------------------------
|
||||
| 1 - 8 | 1 |
|
||||
| 9 - 16 | 2 |
|
||||
| 17 - 32 | 4 |
|
||||
|
||||
Almost all combinations of above flags are supported by
|
||||
'htmlTable...' functions.
|
||||
""")
|
||||
Arguments:
|
||||
byFlags (int) -- bits marking required items:
|
||||
|
||||
| Size in bits| Items Required |
|
||||
--------------------------------
|
||||
| 1 - 8 | 1 |
|
||||
| 9 - 16 | 2 |
|
||||
| 17 - 32 | 4 |
|
||||
|
||||
Almost all combinations of above flags are supported by
|
||||
'htmlTable...' functions.
|
||||
""")
|
||||
|
||||
|
||||
commentVerifier.check(doxygen_translate.htmlEntitiesFunction.__doc__,
|
||||
r"""
|
||||
All entities are treated as commands (C) TM (R)
|
||||
should work also<in text
|
||||
>
|
||||
&
|
||||
'
|
||||
"
|
||||
`
|
||||
'
|
||||
"
|
||||
"
|
||||
-
|
||||
--
|
||||
|
||||
x
|
||||
-
|
||||
.
|
||||
~
|
||||
<=
|
||||
>=
|
||||
<--
|
||||
-->
|
||||
Not an html entity - ignored by Doxygen.
|
||||
Not an &text html entity - ampersand is replaced with entity.
|
||||
""")
|
||||
All entities are treated as commands (C) TM (R)
|
||||
should work also<in text
|
||||
>
|
||||
&
|
||||
'
|
||||
"
|
||||
`
|
||||
'
|
||||
"
|
||||
"
|
||||
-
|
||||
--
|
||||
|
||||
x
|
||||
-
|
||||
.
|
||||
~
|
||||
<=
|
||||
>=
|
||||
<--
|
||||
-->
|
||||
Not an html entity - ignored by Doxygen.
|
||||
Not an &text html entity - ampersand is replaced with entity.
|
||||
""")
|
||||
|
|
|
|||
14
Examples/test-suite/python/unicode_strings_runme.py
Normal file
14
Examples/test-suite/python/unicode_strings_runme.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import sys
|
||||
|
||||
import unicode_strings
|
||||
|
||||
# The 'u' string prefix isn't valid in Python 3.0 - 3.2 and is redundant
|
||||
# in 3.3+. Since this file is run through 2to3 before testing, though,
|
||||
# mark this as a unicode string in 2.x so it'll become a str in 3.x.
|
||||
test_string = u'h\udce9llo w\u00f6rld'
|
||||
|
||||
if sys.version_info[0:2] >= (3, 1):
|
||||
if unicode_strings.non_utf8_c_str() != test_string:
|
||||
raise ValueError('Test comparison mismatch')
|
||||
if unicode_strings.non_utf8_std_string() != test_string:
|
||||
raise ValueError('Test comparison mismatch')
|
||||
|
|
@ -5,22 +5,22 @@ Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin
|
|||
%module python_append
|
||||
|
||||
%pythoncode %{
|
||||
mypath = os.path.dirname("/a/b/c/d.txt")
|
||||
funcpath = None
|
||||
staticfuncpath = None
|
||||
def grabpath():
|
||||
mypath = os.path.dirname("/a/b/c/d.txt")
|
||||
funcpath = None
|
||||
staticfuncpath = None
|
||||
def grabpath():
|
||||
return funcpath
|
||||
def grabstaticpath():
|
||||
def grabstaticpath():
|
||||
return staticfuncpath
|
||||
%}
|
||||
|
||||
%pythonappend Test::func %{
|
||||
funcpath = os.path.dirname(funcpath)
|
||||
funcpath = os.path.dirname(funcpath)
|
||||
%}
|
||||
|
||||
%pythonprepend Test::func %{
|
||||
global funcpath
|
||||
funcpath = mypath
|
||||
global funcpath
|
||||
funcpath = mypath
|
||||
%}
|
||||
|
||||
%pythonappend Test::static_func %{
|
||||
|
|
@ -29,9 +29,9 @@ pass
|
|||
%}
|
||||
|
||||
%pythonprepend Test::static_func {
|
||||
global staticfuncpath
|
||||
staticfuncpath = mypath
|
||||
pass
|
||||
global staticfuncpath
|
||||
staticfuncpath = mypath
|
||||
pass
|
||||
}
|
||||
|
||||
%pythonbegin %{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ LANGUAGE = r
|
|||
SCRIPTSUFFIX = _runme.R
|
||||
WRAPSUFFIX = .R
|
||||
RUNR = R CMD BATCH --no-save --no-restore
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -48,24 +49,24 @@ include $(srcdir)/../common.mk
|
|||
# Run the runme if it exists. If not just load the R wrapper to
|
||||
# check for syntactic correctness
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
else \
|
||||
$(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX); \
|
||||
$(RUNTOOL) $(RUNR) ./$(SCRIPTPREFIX)$*$(WRAPSUFFIX); \
|
||||
fi
|
||||
|
||||
run_multitestcase = \
|
||||
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) ]; then \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" \
|
||||
$(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX); \
|
||||
$(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX); \
|
||||
else \
|
||||
$(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX); \
|
||||
$(RUNTOOL) $(RUNR) ./$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX); \
|
||||
fi; \
|
||||
done
|
||||
# Clean
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile r_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" r_clean
|
||||
|
||||
%.clean:
|
||||
@rm -f $*.R $*_wrap.so $*_wrap.cpp $*_wrap.c $*_wrap.o $*_runme.Rout $*.Rout
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = ruby
|
||||
RUBY = @RUBY@
|
||||
SCRIPTSUFFIX = _runme.rb
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -60,8 +61,8 @@ ruby_naming.cpptest: SWIGOPT += -autorename
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.rb appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(RUBY) -I$(srcdir):. $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(RUBY) -I$(srcdir):. $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean
|
||||
|
|
@ -69,4 +70,4 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile ruby_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" ruby_clean
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public:
|
|||
%template(QueryInterfaceObjct) Objct::QueryInterface<Objct>;
|
||||
#endif
|
||||
|
||||
}; // namespace
|
||||
} // namespace
|
||||
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
%inline %{
|
||||
|
||||
// Named types
|
||||
/* Named types */
|
||||
struct StructA {
|
||||
int x;
|
||||
} instanceA1;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
LANGUAGE = tcl
|
||||
TCLSH = tclsh
|
||||
SCRIPTSUFFIX = _runme.tcl
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
|
@ -45,8 +46,8 @@ include $(srcdir)/../common.mk
|
|||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.tcl appended after the testcase name.
|
||||
run_testcase = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(TCLSH) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(TCLSH) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
|
||||
fi
|
||||
|
||||
# Clean
|
||||
|
|
@ -54,4 +55,4 @@ run_testcase = \
|
|||
@exit 0
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile tcl_clean
|
||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR="$(SRCDIR)" tcl_clean
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ $1 = 0;
|
|||
/* Correct typemap for $symname: $type */
|
||||
}
|
||||
%inline %{
|
||||
void func1a(myarray x) {};
|
||||
void func1b(volatile myarray x) {};
|
||||
void func1a(myarray x) {}
|
||||
void func1b(volatile myarray x) {}
|
||||
%}
|
||||
|
||||
CLEAR_SWIGTYPE_TYPEMAPS;
|
||||
|
|
@ -57,9 +57,9 @@ $1 = 0;
|
|||
/* Correct typemap for $symname: $type */
|
||||
}
|
||||
%inline %{
|
||||
void func2a(const myarray x) {};
|
||||
void func2b(const myconstarray x) {};
|
||||
void func2c(const volatile myconstarray x) {};
|
||||
void func2a(const myarray x) {}
|
||||
void func2b(const myconstarray x) {}
|
||||
void func2c(const volatile myconstarray x) {}
|
||||
%}
|
||||
|
||||
CLEAR_SWIGTYPE_TYPEMAPS;
|
||||
|
|
@ -72,7 +72,7 @@ $1 = 0;
|
|||
/* Correct typemap for $symname: $type */
|
||||
}
|
||||
%inline %{
|
||||
void func3a(const mycrazyarray x, const mycrazyarray y[7]) {};
|
||||
void func3a(const mycrazyarray x, const mycrazyarray y[7]) {}
|
||||
%}
|
||||
|
||||
CLEAR_SWIGTYPE_TYPEMAPS;
|
||||
|
|
@ -81,5 +81,5 @@ $1 = 0;
|
|||
/* Correct typemap for $symname: $type */
|
||||
}
|
||||
%inline %{
|
||||
void func4a(mycrazyfunc *const x, const mycrazyfuncptr y) {};
|
||||
void func4a(mycrazyfunc *const x, const mycrazyfuncptr y) {}
|
||||
%}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue