[前][次][番号順一覧][スレッド一覧]

ruby-changes:19637

From: kosaki <ko1@a...>
Date: Sun, 22 May 2011 09:31:25 +0900 (JST)
Subject: [ruby-changes:19637] kosaki:r31681 (trunk): * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):

kosaki	2011-05-22 09:31:19 +0900 (Sun, 22 May 2011)

  New Revision: 31681

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31681

  Log:
    * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
      use spawn. it prevent that other tests inherit renamed $0.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_rubyoptions.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31680)
+++ ChangeLog	(revision 31681)
@@ -1,3 +1,8 @@
+Sun May 22 09:29:43 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+	  use spawn. it prevent that other tests inherit renamed $0.
+
 Sun May 22 08:57:13 2011  Martin Bosslet  <Martin.Bosslet@g...>
 
 	* ext/openssl/ossl_asn1.c: Default tag lookup in constant time via hash
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 31680)
+++ test/ruby/test_rubyoptions.rb	(revision 31681)
@@ -403,9 +403,10 @@
   def test_set_program_name
     skip if /linux|freebsd|netbsd|openbsd/ !~ RUBY_PLATFORM
 
-    $0 = 'hello world'
-    ps = `ps -p #{$$} -o command`
+    pid = spawn([EnvUtil.rubybin, %!-e "$0 = 'hello world'; sleep 100"!])
+    ps = `ps -p #{pid} -o command`
     assert_match(/hello world/, ps)
+    Process.kill :KILL, pid
   end
 
   def test_segv_test

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]