3 exit if defined?(CROSS_COMPILING)
7 ruby = "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}"
8 unless File.exist? ruby
9 print "#{ruby} is not found.\n"
10 print "Try `make' first, then `make test', please.\n"
14 if File.exist? CONFIG['LIBRUBY_SO']
17 dldpath = "SHLIB_PATH"
21 dldpath = "LIBRARY_PATH"
23 dldpath = "DYLD_LIBRARY_PATH"
25 dldpath = "LD_LIBRARY_PATH"
32 if /linux/ =~ RUBY_PLATFORM and File.exist? CONFIG['LIBRUBY_SO']
33 ENV["LD_PRELOAD"] = "./#{CONFIG['LIBRUBY_SO']}"
36 $stderr.reopen($stdout)
39 srcdir = File.dirname(__FILE__)
40 `#{ruby} -I.ext/#{RUBY_PLATFORM} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each_line do |line|
41 if line =~ /^end of test/
42 print "\ntest succeeded\n"
45 error << line if %r:^(sample/test.rb|not): =~ line