summaryrefslogtreecommitdiff
path: root/rubytest.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-07-15 07:59:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-07-15 07:59:59 +0000
commit86307f52ee1b3c5aa76e2fd6ee118e681dd76905 (patch)
tree4f5675ce901200d4245c6697d4e8d1c224949174 /rubytest.rb
parente12510c502a3c8a81aeda66d1867eb1e760ce533 (diff)
990715
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rubytest.rb')
-rw-r--r--rubytest.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/rubytest.rb b/rubytest.rb
index 3bf11b3ba5..32b2844a9f 100644
--- a/rubytest.rb
+++ b/rubytest.rb
@@ -1,12 +1,27 @@
#! ./miniruby -I.
-x = ENV["LD_LIBRARY_PATH"]
-x = x ? x+":." : "."
-ENV["LD_LIBRARY_PATH"] = x
-
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 File.exist? CONFIG['LIBRUBY_SO']
+ ENV["LD_PRELOAD"] ||= ""
+ ENV["LD_PRELOAD"] += " ./#{CONFIG['LIBRUBY_SO']}"
+end
+
$stderr.reopen($stdout)
error = ''
`./#{CONFIG["ruby_install_name"]} #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|