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:
commit
e668c47b70
1094 changed files with 39390 additions and 11483 deletions
4
Examples/test-suite/errors/.gitignore
vendored
4
Examples/test-suite/errors/.gitignore
vendored
|
|
@ -1,4 +0,0 @@
|
|||
*.newerr
|
||||
cpp_recursive_typedef.py
|
||||
cpp_shared_ptr.py
|
||||
xxx.py
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
%module xxx
|
||||
|
||||
int foo(int x = 42 || 3);
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
%module xxx
|
||||
|
||||
int foo(int x, ...);
|
||||
19
Examples/test-suite/errors/cpp_inherit_ignored.i
Normal file
19
Examples/test-suite/errors/cpp_inherit_ignored.i
Normal 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 {};
|
||||
%}
|
||||
3
Examples/test-suite/errors/cpp_inherit_ignored.stderr
Normal file
3
Examples/test-suite/errors/cpp_inherit_ignored.stderr
Normal 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.
|
||||
|
|
@ -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);
|
||||
};
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
%module xxx
|
||||
|
||||
class foo {
|
||||
static const int BAR = 42;
|
||||
public:
|
||||
int blah(int x = BAR);
|
||||
};
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
%module xxx
|
||||
|
||||
template<T> T blah(T x);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 >'.
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
%module xxx
|
||||
|
||||
#define foo(a,x) a x
|
||||
|
||||
#if foo
|
||||
#endif
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
7
Examples/test-suite/errors/swig_pythoncode_bad3.i
Normal file
7
Examples/test-suite/errors/swig_pythoncode_bad3.i
Normal 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
|
||||
%}
|
||||
1
Examples/test-suite/errors/swig_pythoncode_bad3.stderr
Normal file
1
Examples/test-suite/errors/swig_pythoncode_bad3.stderr
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue