Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 50 lines (43 sloc) 1.088 kb
511dc44 initial import
Laurent Sansonetti authored
1 #! ./miniruby
2
3 exit if defined?(CROSS_COMPILING)
4 load './rbconfig.rb'
5 include RbConfig
6
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"
11 exit false
12 end
13
14 if File.exist? CONFIG['LIBRUBY_SO']
15 case RUBY_PLATFORM
16 when /-hpux/
17 dldpath = "SHLIB_PATH"
18 when /-aix/
19 dldpath = "LIBPATH"
20 when /-beos/
21 dldpath = "LIBRARY_PATH"
22 when /-darwin/
23 dldpath = "DYLD_LIBRARY_PATH"
24 else
25 dldpath = "LD_LIBRARY_PATH"
26 end
27 x = ENV[dldpath]
28 x = x ? ".:"+x : "."
29 ENV[dldpath] = x
30 end
31
32 if /linux/ =~ RUBY_PLATFORM and File.exist? CONFIG['LIBRUBY_SO']
33 ENV["LD_PRELOAD"] = "./#{CONFIG['LIBRUBY_SO']}"
34 end
35
36 $stderr.reopen($stdout)
37 error = ''
38
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"
43 exit true
44 end
45 error << line if %r:^(sample/test.rb|not): =~ line
46 end
47 print error
48 print "test failed\n"
49 exit false
Something went wrong with that request. Please try again.