1999-01-20 07:59:39 +03:00
|
|
|
#! ./miniruby -I.
|
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
require 'rbconfig'
|
|
|
|
include Config
|
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
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
|
|
|
|
|
1998-01-16 15:19:09 +03:00
|
|
|
$stderr.reopen($stdout)
|
|
|
|
error = ''
|
1999-08-13 09:45:20 +04:00
|
|
|
`./#{CONFIG["ruby_install_name"]} #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|
|
1998-01-16 15:19:09 +03:00
|
|
|
if line =~ /^end of test/
|
|
|
|
print "test succeeded\n"
|
|
|
|
exit 0
|
|
|
|
end
|
|
|
|
error << line if line =~ %r:^(sample/test.rb|not):
|
|
|
|
end
|
|
|
|
print error
|
|
|
|
print "test failed\n"
|
1999-08-24 12:21:56 +04:00
|
|
|
exit 1
|