summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2015-03-12fix env leaksnobu
* lib/rubygems/test_case.rb (setup, teardown): fix environment variable change leaks. * test/cgi/update_env.rb: ditto. * test/rake/test_rake_application_options.rb (setup, teardown): ditto. * test/rake/test_rake_file_utils.rb (setup, teardown): ditto. * test/rubygems/test_gem_request.rb (setup): add https_proxy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12* test/lib/leakchecker.rb: Check environment variables.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-12accept_nonblock supports "exception: false"normal
This is analogous to functionality found in IO#read_nonblock and IO#wait_nonblock. Raising exceptions for common failures on non-blocking servers is expensive and makes $DEBUG too noisy. Benchmark results: user system total real default 2.790000 0.870000 3.660000 ( 3.671597) exception: false 1.120000 0.800000 1.920000 ( 1.922032) exception: false (cached arg) 0.820000 0.770000 1.590000 ( 1.589267) --------------------- benchmark script ------------------------ require 'socket' require 'benchmark' require 'tmpdir' nr = 1000000 Dir.mktmpdir('nb_bench') do |path| sock_path = "#{path}/test.sock" s = UNIXServer.new(sock_path) Benchmark.bmbm do |x| x.report("default") do nr.times do begin s.accept_nonblock rescue IO::WaitReadable end end end x.report("exception: false") do nr.times do begin s.accept_nonblock(exception: false) rescue IO::WaitReadable abort "should not raise" end end end x.report("exception: false (cached arg)") do arg = { exception: false } nr.times do begin s.accept_nonblock(arg) rescue IO::WaitReadable abort "should not raise" end end end end end * ext/socket/init.c (rsock_s_accept_nonblock): support exception: false [ruby-core:66385] [Feature #10532] * ext/socket/init.c (rsock_init_socket_init): define new symbols * ext/socket/rubysocket.h: adjust prototype * ext/socket/socket.c (sock_accept_nonblock): support exception: false * ext/openssl/ossl_ssl.c (ossl_ssl_accept_nonblock): ditto * ext/socket/socket.c (Init_socket): adjust accept_nonblock definition * ext/openssl/ossl_ssl.c (Init_ossl_ssl): ditto * ext/socket/tcpserver.c (rsock_init_tcpserver): ditto * ext/socket/unixserver.c (rsock_init_unixserver): ditto * ext/socket/tcpserver.c (tcp_accept_nonblock): adjust rsock_s_accept_nonblock call * ext/socket/unixserver.c (unix_accept_nonblock): ditto * ext/openssl/ossl_ssl.c (ossl_start_ssl): support no_exception * ext/openssl/ossl_ssl.c (ossl_ssl_connect): adjust ossl_start_ssl call * ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock): ditto * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto * test/socket/test_nonblock.rb (test_accept_nonblock): test for "exception :false" * test/socket/test_tcp.rb (test_accept_nonblock): new test * test/socket/test_unix.rb (test_accept_nonblock): ditto * test/openssl/test_pair.rb (test_accept_nonblock_no_exception): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* test/rubygems/test_gem_security_trust_dir.rb: The return value ofodaira
File::Stat#mode is OS dependent. In AIX, 0200000 is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10* lib/webrick/server.rb: Invoke setup_shutdown_pipe in start methodakr
instead of listen method. [ruby-core:68476] [Bug #10956] Reported by Shintaro Kojima. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-10test_math.rb: to_f testsnobu
* test/ruby/test_math.rb (test_{fixnum,bignum,rational}_to_f): refine to_f tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-09stringio.c: don't raise after closenobu
* ext/stringio/stringio.c (strio_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-09suppress warningsnobu
* test/ruby/beginmainend.rb: suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-09test_beginendblock.rb: assert_in_out_errnobu
* test/ruby/test_beginendblock.rb (TestBeginEndBlock): simplify with assert_in_out_err. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08* ext/zlib/zlib.c (rb_gzfile_close): Don't raise on doubleakr
close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08dir.c: glob short namesnobu
* dir.c (glob_helper): match patterns against legacy short names too, not only ordinary names. [ruby-core:67954] [Bug #10819] * win32/dir.h (struct direct): add short name members. * win32/win32.c (opendir_internal, readdir_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08test_extlibs.rb: skip excluded librariesnobu
* test/ruby/test_extlibs.rb (TestExtLibs.check_existence): ignore tests for explicitly excluded libraries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06* fix namespace issue on singleton class expressions. [Bug #10943]ko1
* vm_core.h, method.h: remove rb_iseq_t::cref_stack. CREF is stored to rb_method_definition_t::body.iseq_body.cref. * vm_insnhelper.c: modify SVAR usage. When calling ISEQ type method, push CREF information onto method frame, SVAR located place. Before this fix, SVAR is simply nil. After this patch, CREF (or NULL == Qfalse for not iseq methods) is stored at the method invocation. When SVAR is requierd, then put NODE_IF onto SVAR location, and NDOE_IF::nd_reserved points CREF itself. * vm.c (vm_cref_new, vm_cref_dump, vm_cref_new_toplevel): added. * vm_insnhelper.c (vm_push_frame): accept CREF. * method.h, vm_method.c (rb_add_method_iseq): added. This function accepts iseq and CREF. * class.c (clone_method): use rb_add_method_iseq(). * gc.c (mark_method_entry): mark method_entry::body.iseq_body.cref. * iseq.c: remove CREF related codes. * insns.def (getinlinecache/setinlinecache): CREF should be cache key because a different CREF has a different namespace. * node.c (rb_gc_mark_node): mark NODE_IF::nd_reserved for SVAR. * proc.c: catch up changes. * struct.c: ditto. * insns.def: ditto. * vm_args.c (raise_argument_error): ditto. * vm_eval.c: ditto. * test/ruby/test_class.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06* test/webrick/test_filehandler.rb: on vboxsf (on VirtualBoxko1
on Windows 7), file name and permissions are strange (can access by short file name and so on). Simply skip on such tests on such FS. To detect strange FS, this patch use a part of code `File.executable?(__FILE__)`. Please correct them if there are better ways. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06* test/ruby/test_beginendblock.rb: do not change directory.ko1
Run system command in the directory mounted by vboxfs on Windows 7 and get warning like that "warning: Insecure world writable dir...". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-06vm_eval.c: next super class from the originalnobu
* vm_eval.c (vm_call_super): search next super class from the original class, to get rid of infinite recursion with prepending. a patch by Seiei Higa <hanachin AT gmail.com> at [ruby-core:68434]. [ruby-core:68093] [Bug #10847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05* lib/matrix.rb: Add Vector#round. Patch by Jordan Stephens.marcandre
[Fixes GH-802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05* test/ruby/test_rubyoptions.rb ↵usa
(TestRubyOptions#test_command_line_glob_with_dir): test for r49859. see [ruby-core:68430] [Bug #10941] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05* vm_eval.c (eval_string_with_cref): A binding should keepshugo
refinements activation information and the refinements should be activated in subsequent eval calls with the binding. [ruby-core:67945] [Bug #10818] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05* test/ruby/test_refinement.rb: There is no need anymore to supressshugo
warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-04* test/ruby/test_math.rb (assert_float_and_int): Refactor test casesgogotanaka
by introducing assert_float_and_int. [misc #10810] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-04envutil.rb: no need to sleepnobu
* test/lib/envutil.rb (assert_in_out_err): remove sleep to catch the just time, and it is unnecessary as diagnostic_reports waits for 3 seconds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-04envutil.rb: diagnostic_reports for SIGTRAPnobu
* test/lib/envutil.rb (EnvUtil.diagnostic_reports): SIGTRAP also generate diagnostic report file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03mkmf/base.rb: clean up tmpdirnobu
* test/mkmf/base.rb (TestMkmf#assert_separately): call teardown to clean up temporary directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03* test/lib/envutil.rb (EnvUtil.invoke_ruby): need to rescue becauseusa
Signal.signame may raise exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03test_rubyoptions.rb: use assert_in_out_errnobu
* test/ruby/test_rubyoptions.rb (assert_segv): assert_in_out_err with the pattern list instead of invoke_ruby. * test/-ext-/bug_reporter/test_bug_reporter.rb (test_bug_reporter_add): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03envutil.rb: improve by assert_pattern_listnobu
* test/lib/envutil.rb (assert_in_out_err): improve to match by assert_pattern_list if expected result is other than Regexp or String list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03test_process.rb: use assert_in_out_errnobu
* test/ruby/test_process.rb (test_status_quit): use assert_in_out_err to simplify and clean diagnostic reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03* test/ruby/test_math.rb: add tests for the above change.gogotanaka
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-03test_rubyoptions.rb: use assert_segvnobu
* test/ruby/test_rubyoptions.rb (test_segv_loaded_features): use assert_segv to simplify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02* test/ruby/test_symbol.rb: avoid a false positive in AIXodaira
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02envutil.rb: fix typonobu
* test/lib/envutil.rb (invoke_ruby): fix typo again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02envutil.rb: fix const namenobu
* test/lib/envutil.rb (invoke_ruby): fix an exception class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02test_process.rb: remove intermediate child processnobu
* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): spawn the target process directly with assert_separately and remove intermediate child process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02envutil.rb: timeout_error argument to invoke_rubynobu
* test/lib/envutil.rb (invoke_ruby): add `timeout_error` optional keyword argument, the exception class to be raised if the target process timed out. if it is nil, no exception will be raised at timeout but the terminated output, error, and status will be returned. defaulted to Timeout::Error. * test/lib/envutil.rb (assert_separately): check outputs and status (including diagnostic reports) of timed-out process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02envutil.rb: signal list to invoke_rubynobu
* test/lib/envutil.rb (invoke_ruby): allow `signal` optional keyword argument to be a list of signals to be sent to the target process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02signal.c: nil for invalid signumnobu
* signal.c (sig_signame): return nil if the argument is a valid signal number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02* test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINEngoto
for receiving OOB data which is sended with MSG_OOB flag in portable way. [Bug #10915] [ruby-dev:48885] * test/net/ftp/test_ftp.rb (test_abort, test_status): use gets for receiving OOB data in portable way. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01io/wait: fix return value for buffered readnormal
* ext/io/wait/wait.c (io_nread): wrap return value with INT2FIX Thanks to Yura Sokolov <funny.falcon@gmail.com> [ruby-core:68369] [Bug#10923] * test/io/wait/test_io_wait.rb (test_nread_buffered): fix broken test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01envutil.rb: signal argumentnobu
* test/lib/envutil.rb (invoke_ruby): add optional keyword argument of signal to be sent to hung-up process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-01add tests for strptime("%s.%N").akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-28enum.c: Fixnum onlynobu
* enum.c (limit_by_enum_size, enum_size_over_p): check only against Fixnum size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-28enum.c: limit sizenobu
* enum.c (enum_each_slice, enum_each_cons): limit elements size by the enumerator size. suggested by Hans Mackowiak <hanmac AT gmx.de> at [ruby-core:68335] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-28variable.c: preserve name encoding of subclassnobu
* variable.c (rb_tmp_class_path): preserve name encoding of an anonymous instance of module/class subclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-27* lib/rubygems: Update to RubyGems 2.4.6 and HEAD(800f2e6).hsbt
Fixed #1159, #1171, #1173 on rubygems/rubygems * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-27* lib/rake: Update to rake (9237e74), typo fix and remove needlesshsbt
private syntax. * test/rake: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-26test_io.rb: separate platform-specific testsnobu
* test/ruby/test_io.rb: separate platform-specific tests at load time instead of runtime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-25* ext/win32/Win32API.rb (initialize): accept both a string and an arrayusa
for the arguments of the imported function. reported by Aaron Stone [ruby-core:68208] [Bug #10876] [Fixes GH-835] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-25dir.c: same encoding to the patternnobu
* dir.c (push_pattern, push_glob): make globbed file names same encoding to the given pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-24* lib/cmath.rb (log): raise ArgumentError when more than 2 argumentsgogotanaka
are passed. [ruby-core:66143] [Bug #10487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e