Merge branch 'master' into doxygen

The way Python docstrings are indented has changed on master, so use the
standard inspect module in Python autodoc unit test to ignore the differences
in their indentation level between -builtin and non-builtin cases to make the
test still pass with the branch version, which avoids the use of different
(but almost identical) values in the test itself.
This commit is contained in:
Vadim Zeitlin 2016-12-05 02:14:51 +01:00
commit e668c47b70
1094 changed files with 39390 additions and 11483 deletions

View file

@ -1,4 +0,0 @@
*.newerr
cpp_recursive_typedef.py
cpp_shared_ptr.py
xxx.py

View file

@ -20,6 +20,9 @@ srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
SWIG_LIB_SET = @SWIG_LIB_SET@
SWIGINVOKE = $(SWIG_LIB_SET) $(SWIGTOOL) $(SWIGEXE)
# 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,%, $(notdir $(wildcard $(srcdir)/*.i)))
CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES))
@ -44,7 +47,7 @@ $(DOXYGEN_ERROR_TEST_CASES): SWIGOPT += -doxygen
# Portable dos2unix / todos for stripping CR
TODOS = tr -d '\r'
#TODOS = sed -e 's/\r$$//' # On OSX behaves as if written 's/r$$//'
#TODOS = sed -e 's/\r$$//' # On Mac OS X behaves as if written 's/r$$//'
# strip source directory from output, so that diffs compare
STRIP_SRCDIR = sed -e 's|\\|/|g' -e 's|^$(SRCDIR)||'
@ -52,17 +55,17 @@ 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) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
-$(SWIGINVOKE) -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) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
-$(SWIGINVOKE) -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 SRCDIR="$(SRCDIR)" python_clean
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' python_clean
@rm -f *.$(ERROR_EXT) *.py

View file

@ -1,4 +0,0 @@
%module xxx
int foo(int x = 42 || 3);

View file

@ -1,3 +0,0 @@
%module xxx
int foo(int x, ...);

View file

@ -0,0 +1,19 @@
%module xxx
// Only non-ignored classes should warn about Ignored base classes
%ignore ActualClass;
%ignore ActualClassNoTemplates;
%{
struct BaseClassNoTemplates {};
%}
%inline %{
template<typename T>
class TemplateClass {};
class ActualClass : public TemplateClass<int> {};
class AktuelKlass : public TemplateClass<int> {};
class ActualClassNoTemplates : public BaseClassNoTemplates {};
class AktuelKlassNoTemplates : public BaseClassNoTemplates {};
%}

View file

@ -0,0 +1,3 @@
cpp_inherit_ignored.i:15: Warning 401: Nothing known about base class 'TemplateClass< int >'. Ignored.
cpp_inherit_ignored.i:15: Warning 401: Maybe you forgot to instantiate 'TemplateClass< int >' using %template.
cpp_inherit_ignored.i:18: Warning 401: Nothing known about base class 'BaseClassNoTemplates'. Ignored.

View file

@ -1,15 +0,0 @@
%module xxx
int foo(int x);
int foo(double x);
class Foo {
public:
int bar(int);
int bar(double);
};
class Spam {
public:
Spam();
Spam(int);
};

View file

@ -1,7 +0,0 @@
%module xxx
class foo {
static const int BAR = 42;
public:
int blah(int x = BAR);
};

View file

@ -1,8 +0,0 @@
%module xxx
template<T> T blah(T x);

View file

@ -4,4 +4,4 @@ template<class T> T blah(T x) { };
%template(iblah) blah<int>;
%template(iiblah) blah<int>;
// The second %template instantiation above should surely be ignored with a warning, but doesn't atm

View file

@ -1,3 +0,0 @@
cpp_using_type_aliasing.i:8: Warning 341: The 'using' keyword in type aliasing is not fully supported yet.
cpp_using_type_aliasing.i:8: Warning 315: Nothing known about 'Okay< int >'.
cpp_using_type_aliasing.i:8: Warning 315: Nothing known about 'Okay< int >'.

View file

@ -1,7 +0,0 @@
%module xxx
#define foo(a,x) a x
#if foo
#endif

View file

@ -1 +1 @@
swig_pythoncode_bad.i:7: Error: Line indented less than expected (line 2 of pythoncode)
swig_pythoncode_bad.i:7: Error: Line indented less than expected (line 2 of %pythoncode or %insert("python") block) as no line should be indented less than the indentation in line 1

View file

@ -1 +1 @@
swig_pythoncode_bad2.i:13: Error: Line indented less than expected (line 3 of pythoncode)
swig_pythoncode_bad2.i:13: Error: Line indented less than expected (line 3 of %pythoncode or %insert("python") block) as no line should be indented less than the indentation in line 1

View file

@ -0,0 +1,7 @@
%module xxx
%pythoncode %{
def extra():
print "extra a" # indentation is 2 spaces then tab
print "extra b" # indentation is tab then 2 spaces
%}

View file

@ -0,0 +1 @@
swig_pythoncode_bad3.i:7: Warning 740: Whitespace indentation is inconsistent compared to earlier lines (line 3 of %pythoncode or %insert("python") block)