Merge branch 'more_argcargv'
* more_argcargv: Document argc argv library argcargv.i cosmetic updates Typemaps for (int ARGC, char **ARGV) fixup Fix argcargv.i in Perl5, Tcl, PHP Add missing type map for type check. Add testing of argcargv.i for Perl5, Tcl, PHP and Ruby. Add Lua test for argcargv.i Add argcargv.i to more languages: Perl 5, Tcl, PHP Add argcargv.i to Lua
This commit is contained in:
commit
d60724b636
15 changed files with 360 additions and 23 deletions
32
Examples/test-suite/ruby/argcargvtest_runme.rb
Normal file
32
Examples/test-suite/ruby/argcargvtest_runme.rb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'swig_assert'
|
||||
require 'argcargvtest'
|
||||
|
||||
include Argcargvtest
|
||||
|
||||
|
||||
$largs = ["hi", "hola", "hello"]
|
||||
if mainc($largs) != 3
|
||||
raise RuntimeError, "bad main typemap"
|
||||
end
|
||||
|
||||
$targs = ["hi", "hola"]
|
||||
if mainv($targs, 1) != "hola"
|
||||
raise RuntimeError, "bad main typemap"
|
||||
end
|
||||
|
||||
$error = 0
|
||||
$ret = 0
|
||||
begin
|
||||
mainv("hello", 1)
|
||||
$error = 1
|
||||
rescue => e
|
||||
$ret = 1
|
||||
end
|
||||
|
||||
if $error == 1 or $ret != 1
|
||||
raise RuntimeError, "bad main typemap"
|
||||
end
|
||||
|
||||
initializeApp($largs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue