diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:02:05 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:02:05 +0000 |
commit | 0dc342de848a642ecce8db697b8fecd83a63e117 (patch) | |
tree | 2b7ed4724aff1f86073e4740134bda9c4aac1a39 /trunk/rubytest.rb | |
parent | ef70cf7138ab8034b5b806f466e4b484b24f0f88 (diff) |
added tag v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/rubytest.rb')
-rwxr-xr-x | trunk/rubytest.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/trunk/rubytest.rb b/trunk/rubytest.rb new file mode 100755 index 0000000000..6c3939a0ac --- /dev/null +++ b/trunk/rubytest.rb @@ -0,0 +1,49 @@ +#! ./miniruby + +exit if defined?(CROSS_COMPILING) +load './rbconfig.rb' +include RbConfig + +ruby = "./#{CONFIG['ruby_install_name']}#{CONFIG['EXEEXT']}" +unless File.exist? ruby + print "#{ruby} is not found.\n" + print "Try `make' first, then `make test', please.\n" + exit false +end + +if File.exist? CONFIG['LIBRUBY_SO'] + case RUBY_PLATFORM + when /-hpux/ + dldpath = "SHLIB_PATH" + when /-aix/ + dldpath = "LIBPATH" + when /-beos/ + dldpath = "LIBRARY_PATH" + when /-darwin/ + dldpath = "DYLD_LIBRARY_PATH" + 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 + +$stderr.reopen($stdout) +error = '' + +srcdir = File.dirname(__FILE__) +`#{ruby} -I.ext/#{RUBY_PLATFORM} -I#{srcdir}/lib #{srcdir}/sample/test.rb`.each_line do |line| + if line =~ /^end of test/ + print "\ntest succeeded\n" + exit true + end + error << line if %r:^(sample/test.rb|not): =~ line +end +print error +print "test failed\n" +exit false |