2000-08-03 09:50:41 +00:00
|
|
|
#! ./miniruby
|
1999-01-20 04:59:39 +00:00
|
|
|
|
2000-08-03 09:50:41 +00:00
|
|
|
load './rbconfig.rb'
|
1998-01-16 12:19:09 +00:00
|
|
|
include Config
|
|
|
|
|
2000-06-14 08:08:50 +00:00
|
|
|
unless File.exist? "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}"
|
2000-06-12 07:48:31 +00:00
|
|
|
print "./#{CONFIG['ruby_install_name']} is not found.\n"
|
|
|
|
print "Try `make' first, then `make test', please.\n"
|
2001-05-06 15:06:00 +00:00
|
|
|
exit 1
|
2000-06-12 07:48:31 +00:00
|
|
|
end
|
|
|
|
|
1999-08-13 05:45:20 +00:00
|
|
|
if File.exist? CONFIG['LIBRUBY_SO']
|
|
|
|
case RUBY_PLATFORM
|
|
|
|
when /-hpux/
|
|
|
|
dldpath = "SHLIB_PATH"
|
|
|
|
when /-aix/
|
|
|
|
dldpath = "LIBPATH"
|
1999-10-13 06:44:42 +00:00
|
|
|
when /-beos/
|
|
|
|
dldpath = "LIBRARY_PATH"
|
1999-08-13 05:45:20 +00:00
|
|
|
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 12:19:09 +00:00
|
|
|
$stderr.reopen($stdout)
|
|
|
|
error = ''
|
2000-06-12 07:48:31 +00:00
|
|
|
|
2000-08-03 09:50:41 +00:00
|
|
|
`./#{CONFIG["ruby_install_name"]}#{CONFIG["EXEEXT"]} #{CONFIG["srcdir"]}/sample/test.rb`.each do |line|
|
1998-01-16 12:19:09 +00: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 08:21:56 +00:00
|
|
|
exit 1
|