Commit graph

3,030 commits

Author SHA1 Message Date
William S Fulton
b175df4e5f C++11 alias templates seg fault fix
Segfault fix when using alias templates, reported by Pierre-Henri Wuillemin
2013-12-03 23:38:54 +00:00
Vadim Zeitlin
ed28725a15 Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
These typemaps are currently defined for C#, Java and Python only and the
tests are provided only for these languages.

Also add a brief description of the new header to the documentation.
2013-12-03 23:45:20 +01:00
Klaus Kämpf
9e2c35f766 Make string encoding explitic
Ruby 2.0 enforces explicit string encodings. The char_constant
testcase fails because the internal (SWIG_FromCharPtrAndSize, using
rb_str_new) defaults to ASCII-8BIT while the test-suite file defaults
to the current shell LOCALE setting.

This patch sets the char_constant_runme.rb encoding to ASCII-8BIT.
2013-11-29 14:02:51 +01:00
William S Fulton
fcd0480364 Fix some cases of C++11 exception specifications on constructors with =default or =delete 2013-11-22 00:13:48 +00:00
William S Fulton
f4ada30a7e Add support for C++11 noexcept specification in exception specifications 2013-11-21 20:20:56 +00:00
William S Fulton
cdefaaf794 Fixes for c_delete and c_delete_function tests 2013-11-21 20:20:56 +00:00
William S Fulton
e566c5fa7f Add support for parsing C++11 =delete and =default
Although this was documented as working, it wasn't implemented
%typemap(default) failed without the idstring changes
Add some C tests using the C++ keyword delete
2013-11-20 19:12:16 +00:00
Robert Stone
81ce0a723e fix "long long" tests for perl v5.6 2013-11-14 11:24:24 -08:00
William S Fulton
65de78b8b4 enum_plus testcase was never been run 2013-11-09 14:54:36 +00:00
William S Fulton
ca5327d0da Remove Lua specifics from keyword_rename testcase 2013-11-09 14:54:36 +00:00
Artem Serebriyskiy
8b35c0b5ce Add runfile to check for correct compatibility name generation
Checks that if OldClass was renamed to NewClass, then not only
OldClass.static_method is now NewClass.static_method, but also
compatibility name OldClass_static_method is now NewClass_static_method.
Same for enums, static vars etc
2013-11-09 14:54:36 +00:00
Artem Serebriyskiy
14de0de5e7 Tests for arrays and global vars 2013-11-09 14:54:35 +00:00
Artem Serebriyskiy
b901979d1c Tests for enum/consts old-style bindings and for static const char; bindings 2013-11-09 14:54:35 +00:00
Artem Serebriyskiy
89bc5576c9 More tests 2013-11-09 14:54:35 +00:00
Artem Serebriyskiy
b9ba05be81 Style patches 2013-11-09 14:54:34 +00:00
Artem Serebriyskiy
c9279ab0e7 More tests 2013-11-09 14:54:34 +00:00
Artem Serebriyskiy
dfc02f306d First banch of tests 2013-11-09 14:54:33 +00:00
William S Fulton
c7b5316912 Merge branch 'master' of https://github.com/BrantKyser/swig
- Remove using directives from the generated C# code and fully qualify the use of all .NET
  framework types in order to minimize potential name collisions from input files defining
  types, namespace, etc with the same name as .NET framework members.
- Globally qualify the use of .NET framework types in the System namespace
- Remove .NET 1.1 support, .NET 2 is the minimum for the C# module

Closes #79

* 'master' of https://github.com/BrantKyser/swig:
  Correct spelling of compatibility.
  Update documentation to reflect fully qualifying the use of .NET types in the generated code.
  Add support for SWIG2_CSHARP macro to create SWIG 2 backwards compatability mode.
  Remove using directives from the generated C# code and fully qualify the use of all .NET framework types in order to minimize potential name collisions from input files defining types, namespace, etc with the same name as .NET framework members.
  Since SWIG 3.0 removes support for .NET 1.1, cleanup the C# library by removing the use of the SWIG_DOTNET_1 macro.
  Globablly qualify the use of types from the .NET framework's System namespace in the C# module and library.
  Add test case to demonstrate the name collision that occurs in the generated C# code when a namespace is named System.
2013-11-09 11:32:50 +00:00
William S Fulton
baec61c5ab java_director_exception_feature_nspace test case changes
- The implementation for SEP for the classpath is not portable, eg the
separator should be ':' not ';' on Cygwin, but clearly it could be ';'
if using a native Windows version of Java. In the past the test-suite
has been constructed to avoid this problem and these changes go back to
this approach at the expense of not testing nspace without -package (but
not specifying -package is quite unusual when using nspace, so no great
loss). This test could be restored to how it was if the separator is
detected at configure time from the JVM itself, eg by calling Java code:

  System.out.println(System.getProperty("path.separator"));

- Mangle the non-public classes in the _runme.java file so that they are
unique to this testcase (the .class files generated can interfere with
other tests).

- Const corrections and spelling mistakes fixed in test case.

test case improvements
2013-11-07 22:50:08 +00:00
William S Fulton
fc13a24ecb directorthrows warning fixes
- Fix line number display - now the usual simpler warning message can be displayed
for WARN_TYPEMAP_DIRECTORTHROWS_UNDEF - it still points to the problem method.
- Use macro names for warning suppression in test.
2013-10-24 07:45:56 +01:00
Marvin Greenberg
6736e74127 Add feature director:except for improved director exception handling in Java
Closes #91
2013-10-22 20:44:35 +01:00
Brant K. Kyser
5f53503b7d Correct spelling of compatibility. 2013-10-22 14:08:47 -05:00
Brant K. Kyser
3720b48847 Add support for SWIG2_CSHARP macro to create SWIG 2 backwards compatability mode. 2013-10-21 13:13:47 -05:00
William S Fulton
152905e193 Fix gcc -Waddress warning in variables examples 2013-10-18 06:53:02 +01:00
Brant K. Kyser
adb93980f2 Remove using directives from the generated C# code and fully qualify the use of all .NET framework types in order to minimize potential name collisions from input files defining types, namespace, etc with the same name as .NET framework members. 2013-10-17 15:44:24 -05:00
Brant K. Kyser
cb2df12630 Since SWIG 3.0 removes support for .NET 1.1, cleanup the C# library by removing the use of the SWIG_DOTNET_1 macro. 2013-10-17 13:58:32 -05:00
Brant K. Kyser
0f1e73fd26 Add test case to demonstrate the name collision that occurs in the generated C# code when a namespace is named System. 2013-10-15 13:55:35 -05:00
Vadim Zeitlin
72afb74f47 Add support for case conversion characters in regex substitutions.
Allow using Perl-like \l, \L, \u, \U and \E escape sequences in the
substitution string used with %rename("%(regex:/pattern/subst/)s").
This is useful for e.g. title casing all string after removing some prefix.

Closes #82
2013-10-15 07:17:56 +01:00
William S Fulton
b17456e617 Merge branch 'gsoc2009-matevz' into master - C++11 support
* gsoc2009-matevz:
  Minor cleanup prior to merging to master
  Add gsoc2009-matevz for Travis testing
  C++11 testing moved to a configure option
  Rename all C++0x to C++11 and cpp0x to cpp11
  Grab .travis.yml file from master to turn on Travis testing
  Suppress leaking memory warnings in rvalue reference tests
  Add support for extern "C++" - no warning should be issued as was previously occurring
  Add support for extern "C" thread_local
  Fixes detecting if a variable is extern when using 'extern thread_local'
  Add support for thread_local when specified with other legitimate storage class specifiers - extern and static
  Remove test tokens
  User defined literals: fix for %rename and update docs
  Add ability to suppress variadic template first argumnet warning
  Add template aliasing and type aliasing into symbol table and enable explicit warning suppression for these. They still need to be added into the parse tree and dealt with.
  Add lambda functions to the symbol tables and add ability to suppress lambda warnings.
  Rework std::initializer_list handling to warn about usage in any method, not just constructors. A typemap is used to issue the warning and can be overridden with user defined behaviour.
  Initialization list doc updates and new tests. Fix functions with default arguments that are initializer lists
  Better clarification about polymorphic wrappers for function objects - std::function
  Remove generated output that should not be checked in2
  Fix shift/shift and shift/reduce errors around variadic templates since merge
  Variadic templates doc update
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Add rvalue reference typemaps
  Use CXXFLAGS for c++ code for Go examples
  Add missing static member to testcase
  More rvalue reference typemaps
  Fix generated code for rvalue references by converting functions returning an rvalue reference into something that can be taken the address of - via a const ref cast. Now the rvalue_reference tests compile under g++-4.7 (C# only atm)
  Remove recently added %expect in parser in case of backward compatibility problems
  Cosmetic changes to previous (unicode literals) commit
  Fixes to previous (unicode literals) commit
  Unicode literals
  Add check-cpp11 target for testing c++11 only tests
  Improve detection of C++11 compiler and set appropriate flags to use C++11/C++0x features
  Modify autoconf macro to be more flexible about how it is used - sets CXX11FLAGS, HAVE_CXX11_COMPILER and option to not error out
  Autoconf archive macro to detect c++11 - as downloaded from archive
  Update variadic templates
  result_of not working
  Add lambda tests to test-suite - gcc-4.7 supports these
  One more lambda test using constexpr
  More lambda support - for optional lambda declarators
  Add in support for initialising auto variables from lambda expressions
  Lambda expressions: parse exception specification in lambda functions. Fix lambda testcase for gcc-4.7.
  Delegating constructors and inheriting constructors clarification and split of tests
  gcc-4.7 now supports alias templates
  Update on C++11 user-defined literal status
  Fix unrestricted unions testcase and add runtime example
  Minor doc tweaks for unrestricted unions
  Some updates to c++11 warning messages and update docs on alias templates
  Provide unique c++11 warnings which were previously hijacking another warning
  Tidy up test and docs on template double brackets
  Better clarify C++11 smart pointer support
  Update c++0x tests run by default for g++-4.6
  Improve nullptr constant wrapping
  Add scoped enums into correct correct scope in type system. Note that cpp0x_strongly_typed_enumerations.i still shows further language symbol table problems which need fixing.
  Using C++11 enum classes with just a forward reference.
  Add support for c++11 strongly typed enums inheriting from non standard primitive types
  Fix parsing of forward declaration of C++0x enums
  html fixes
  sort out c++0x lambda tests and reorder cpp0x tests
  Improved C++0x rvalue reference implementation differentiating lvalue and rvalue references. The previous implementation treated rvalue references as lvalue references which leads to a number of different wrapping issues.
  simple formatting changes
  Warning suppression for explicit template instantiations
  Raw string literal changes in paper N3077 changes delimiters to use round brackets instead of square brackets
  add in more raw string literals for gcc-4.5
  typo fix
  minor warning message changes
  Add new GPL license headers to all source files in this branch
  merge revisions 11872:11876 from trunk to gsoc2009-matevz branch - license changes
  Grammar and formatting improvements
  Added developer documentation for C++0x.
  Fixed testcase warnings.
  Documented C++0x testcases.
  Updated C++0x User's manual.
  Removed decr-- Hash tables feature. Added some comments.
  Added draft user documentation for the C++0x.
  Added warning for initializer_list introduced in C++0x. Added testcase cpp0x_initializer_list.
  Fixed cpp0x_result_of testcase. Added testcase cpp0x_sizeof_object.
  Added testcase for default/delete arguments introduced in C++0x.
  Added cpp0x_result_of testcase.
  Added syntax support for template aliasing and new 'using' syntax for typedefs introduced in C++0x. Added testcase cpp0x_template_typedefs.
  Added testcase cpp0x_constructors for delegating constructors and constructor inheritance.
  Added initial support for C++0x decltype(). Added testcase cpp0x_decltype.
  Added support for user-defined string literals. Added testcase cpp0x_userdefined_literals.i
  Fixed compilation error.
  Added syntax for lambda expressions and closures introduced in C++0x. Added testcase cpp0x_lambda_functions.i.
  Fixed variadic template argument warning.
  Enabled support for variadic %template directive.
  Enabled alternate function syntax and added runtime testcases. Added support for null pointer constant introduced in C++0x.
  Fixed S/R and R/R conflicts. Fixed testcase for rvalue reference.
  Added variadic '...' syntax for inheritance introduced in C++0x. Added sizeof... syntax introduced in C++0x.
  Added initial support for variadic templates.
  Added partial support for unordered_ STL types.
  Added support for C++0x rvalue and move semantics. Added testcase.
  Added initial support for parsing C++0x strongly typed enumerations.
  Fixed bug in cpp0x testcase.
  Added testcase for cpp0x unrestricted unions.
  Disabled alternate function syntax testcase.
  Added testcase for function objects.
  Added initial support for hash tables unordered_ types.
  Added C++0x test case for the hash_tables.
  Added support for C++0x alternate function syntax. Added testcase.
  Added support for cpp0x uniform initialization. Added testcases.
  Fixed cpp0x_raw_string_literals.i test case.
  Added testcase for shared_ptr, unique_ptr and weak_ptr.
  Added keyword 'thread_local' to Swig. Added testcase.
  Added test case.
  Added C++0x support for 'extern' explicit template instantiation without the translation unit. Added test cases.
  Added support for C++0x static_assert().
  Added support for custom string delimiters.
  Added support for unicode strings and fixed support for wstrings. Added test case cpp0x_raw_string_literals.i.
  Added test case for explicit conversion operators. Some cosmetic fixes.
  Added constexpr keywords and CONSTEXPR terminal to Swig parser. Added cpp0x_constexpr.i testcase. Fixed compilation bug of cpp0x_template_double_brackets.i testcase. Removed obsolete cpp0x_template_double_brackets_broken.
  Introduced new CXXFLAGS symbol for the compilation of test suite. Added -std=c++0x to g++ compiler to enable compilation of the new C++0x tests.
  Renamed template_double_brackets -> cpp0x_template_double_brackets. Added CPP0X_TEST_CASES and CPP0X_TEST_BROKEN in common.mk.
  Added support for template double brackets for C++0x. Added test cases.
2013-10-11 21:52:05 +01:00
William S Fulton
7b08378145 Minor cleanup prior to merging to master 2013-10-11 21:48:45 +01:00
William S Fulton
e5f9f91807 Add naturalvar_more testcase runtime test 2013-10-11 19:42:19 +01:00
William S Fulton
bcb7aee022 Merge branch 'master' into gsoc2009-matevz
Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
2013-10-10 07:26:09 +01:00
William S Fulton
de5e0c8655 C++11 testing moved to a configure option
Use './configure --enable-cpp11-testing' to enable the C++11 test.
Off by default for now.
2013-10-08 20:12:18 +01:00
William S Fulton
738cc36aab Rename all C++0x to C++11 and cpp0x to cpp11 2013-10-07 20:37:00 +01:00
William S Fulton
3fcbb40af9 Remove incorrectly and newly introduced assert
Was failing in li_boost_shared_ptr.i for some languages. A similar
testcase has been added into naturalvar_more.i.
2013-10-05 02:16:02 +01:00
William S Fulton
e186d2176a Fix %naturalvar and templated methods using enums
%naturalvar was not being picked up - use the symbol table instead for
looking up the feature.

use_naturalvar_mode() has been moved to Language class (not strictly necessary though)
2013-10-04 23:08:33 +01:00
Olly Betts
12708c9241 Fix typos 2013-09-25 17:29:33 +12:00
William S Fulton
d0cb2b73db Remove X11 detection during configure
X11 is not used anywhere.
2013-09-18 00:40:24 +01:00
William S Fulton
0431664b18 Guile OUTPUT typemap fix
Fixes 'attempt to free a non-heap object' in some OUTPUT typemaps.
2013-09-15 10:43:49 +01:00
William S Fulton
f618a69990 Better detection of Ruby shared library extension
Use Config to detect dll extension (needs to be .so for Ruby 1.9 on Cygwin)
2013-09-14 17:32:54 -07:00
William S Fulton
cb4a23b2df Cygwin test-suite fix for tcl 8.5 on Cygwin 2013-09-14 15:52:42 -07:00
Artem Serebriyskiy
c3f3880d0c Lua static member access improvements.
1) Static members and static functions inside class can be accessed as ModuleName.ClassName.FunctionName (MemberName respectively). Old way aka ModuleName.ClassName_FunctionName still works.
2) Same goes for enums inside classes: ModuleName.ClassName.EnumValue1 etc.
3) More 'runme' tests for lua + modifications to existing tests to test new changes.

Code is loosely based upon python implemenation of the same thing.

Patch #62.
2013-09-12 21:32:26 +01:00
William S Fulton
a91cd0bc5c Infinity is now by default an acceptable value for type 'float'.
This fix makes the handling of type 'float' and 'double' the same. The implementation requires the
C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
2013-09-12 07:28:12 +01:00
William S Fulton
ada7dd92e4 Fix testcase name 2013-08-29 22:49:59 +01:00
William S Fulton
f55ff50dd5 Skip the UTF-8 BOM of including files.
For avoiding illegal token error when parsing include files which have the UTF-8 BOM.

Closes #75.
2013-08-29 19:22:50 +01:00
William S Fulton
b58dabced9 %implicitconv is improved for overloaded functions.
Like in C++, the methods with the actual types are considered before trying implicit conversions.
2013-08-28 20:30:46 +01:00
William S Fulton
1cc735df5e %implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.
Problem highlighted by Bo Peng on the swig-user mailing list. SF patch #230.
2013-08-28 20:28:15 +01:00
William S Fulton
80f8d1d922 Fix for missing C++ code in std::multimap wrappers.
%template for a std::multimap generated uncompilable code unless a
%template for a std::map of the same template types was also coded up.

This patch is needed in conjunction with previous commit - 5f1fff1849

Closes #64
Closes #65
2013-08-06 07:02:49 +01:00
Karl Wette
479df82616 Octave: more robust configuration
- do not rely on --eval argument to find mkoctfile, instead assume it
  is in the same directory as octave itself (which it always should be)
- check Octave options to make sure they are supported, including
  --no-window-system to prevent warnings if building without an X server
- disable Octave if any vital tests fail
2013-07-16 20:59:50 +01:00
joequant
e8c6384f77 add regression tests for SEXP return values 2013-07-14 20:29:37 +08:00