summaryrefslogtreecommitdiff
path: root/rubytest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'rubytest.rb')
-rw-r--r--rubytest.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/rubytest.rb b/rubytest.rb
index cf583c1..61b31ce 100644
--- a/rubytest.rb
+++ b/rubytest.rb
@@ -3,9 +3,27 @@
require 'rbconfig'
include Config
+if File.exist? CONFIG['LIBRUBY_SO']
+ case RUBY_PLATFORM
+ when /-hpux/
+ dldpath = "SHLIB_PATH"
+ when /-aix/
+ dldpath = "LIBPATH"
+ else
+ dldpath = "LD_LIBRARY_PATH"
+ end
+ x = ENV[dldpath]
+ x = x ? ".:"+x : "."
+ ENV[dldpath] = x
+end
+
+if /linux/ =~ RUBY_PLATFORM and File.exist? CONFIG['LIBRUBY_SO']
+ ENV["LD_PRELOAD"] = "./#{CONFIG['LIBRUBY_SO']}"
+end
+
$stderr.reopen($stdout)
error = ''
-`./ruby #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|
+`./#{CONFIG["ruby_install_name"]} #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|
if line =~ /^end of test/
print "test succeeded\n"
exit 0