summaryrefslogtreecommitdiff
path: root/ruby/test/Slice/macros/Client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/test/Slice/macros/Client.rb')
-rwxr-xr-xruby/test/Slice/macros/Client.rb58
1 files changed, 16 insertions, 42 deletions
diff --git a/ruby/test/Slice/macros/Client.rb b/ruby/test/Slice/macros/Client.rb
index 3ca2264c996..2c1ac2ae2ce 100755
--- a/ruby/test/Slice/macros/Client.rb
+++ b/ruby/test/Slice/macros/Client.rb
@@ -8,50 +8,24 @@
#
# **********************************************************************
-require 'pathname'
-
-rubyDir = nil
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]
- path = Pathname.new(toplevel).join("ruby", "Ice.rb")
- if path.file?
- rubyDir = Pathname.new(toplevel).join("ruby")
- break
- end
-end
-if not rubyDir
- fail "can't find toplevel directory!"
-end
-
require 'Ice'
Ice::loadSlice('Test.ice')
-def test(b)
- if !b
- raise RuntimeError, 'test assertion failed'
+class Client < ::TestHelper
+ def run(args)
+ print "testing Slice predefined macros... "
+ STDOUT.flush
+ d = Test::Default.new
+ test(d.x == 10)
+ test(d.y == 10)
+
+ nd = Test::NoDefault.new
+ test(nd.x != 10)
+ test(nd.y != 10)
+
+ c = Test::RubyOnly.new
+ test(c.lang.eql? "ruby")
+ test(c.version == Ice::intVersion())
+ puts "ok"
end
end
-
-status = true
-
-begin
- print "testing Slice predefined macros... "
- STDOUT.flush
- d = Test::Default.new
- test(d.x == 10)
- test(d.y == 10)
-
- nd = Test::NoDefault.new
- test(nd.x != 10)
- test(nd.y != 10)
-
- c = Test::RubyOnly.new
- test(c.lang.eql? "ruby")
- test(c.version == Ice::intVersion())
- puts "ok"
-rescue => ex
- puts $!
- print ex.backtrace.join("\n")
- status = false
-end
-
-exit(status ? 0 : 1)