Project

General

Profile

Feature #4893 ยป test_runner_String_initialize.diff

modification of ./test/runner.rb (for make test-all) - lazaridis.com (Lazaridis Ilias), 07/03/2011 01:35 AM

View differences:

"b/P:\\sand\\rubyi2\\sandbox\\ruby193\\test\\runner.rb"
10 10

  
11 11
require_relative 'profile_test_all' if ENV['RUBY_TEST_ALL_PROFILE'] == 'true'
12 12

  
13
exit Test::Unit::AutoRunner.run(true, src_testdir)
13
#alter String class prior to go into test-all
14
class String
15
  @@running_counter = 0
16
  alias :orig_initialize :initialize
17
  def initialize(*args)
18
    orig_initialize(*args)
19
    @@running_counter += 1
20
  end
21

  
22
  def self.running_counter
23
    @@running_counter
24
  end
25
  
26
end
27

  
28
String.call_initialize = true
29
a = "literalstring" #counter becomes 1
30
puts "\n#{String.call_initialize} #{String.running_counter} - START test/runner.rb MODIFIED TEST"
31

  
32
exitval = Test::Unit::AutoRunner.run(true, src_testdir)
33

  
34
puts "\n#{String.call_initialize} #{String.running_counter} - EXIT test/runner.rb MODIFIED TEST"
35

  
36
exit exitval