This is done in preparation for adding namespace support to the Ruby part of SWIG. Some existing test cases were reorganized or duplicated for flat/nonflat nesting. For some a Ruby test script was added. Finally the ruby/Makefile.in was improved so that for test cases without an explicit test script, the generated wrapper library will be loaded by the Ruby interpreter to ensure loading works fine.
31 lines
539 B
Ruby
31 lines
539 B
Ruby
#!/usr/bin/env ruby
|
|
#
|
|
# Runtime tests for enums.i
|
|
#
|
|
|
|
require 'swig_assert'
|
|
require 'enums'
|
|
|
|
swig_assert_each_line( <<EOF )
|
|
Enums::CSP_ITERATION_FWD == 0
|
|
Enums::CSP_ITERATION_BWD == 11
|
|
Enums::ABCDE == 0
|
|
Enums::FGHJI == 1
|
|
Enums.bar1(1)
|
|
Enums.bar2(1)
|
|
Enums.bar3(1)
|
|
Enums::Boo == 0
|
|
Enums::Hoo == 5
|
|
Enums::Globalinstance1 == 0
|
|
Enums::Globalinstance2 == 1
|
|
Enums::Globalinstance3 == 30
|
|
Enums::AnonEnum1 == 0
|
|
Enums::AnonEnum2 == 100
|
|
Enums::BAR1 == 0
|
|
Enums::BAR2 == 1
|
|
EOF
|
|
|
|
swig_assert_each_line( <<EOF )
|
|
Enums::Phoo == 50
|
|
Enums::Char == 'a'[0]
|
|
EOF
|