Project

General

Profile

Feature #4893 ยป bootstraptest_runner_addition.diff

lazaridis.com (Lazaridis Ilias), 06/26/2011 08:06 PM

View differences:

"b/P:\\sand\\rubyi2\\sandbox\\rb192\\bootstraptest\\runner.rb"
7 7
# Never use test/unit in this file.
8 8
# Never use Ruby extensions in this file.
9 9

  
10
class String
11
  @@running_counter = 0
12
  def initialize(val)
13
    @@running_counter += 1
14
  end
15

  
16
  def self.running_counter
17
    @@running_counter
18
  end
19
end
20

  
21
String.call_initialize = true
22
p String.call_initialize
23
p "TEST TEST"
24
p String.running_counter
25

  
10 26
begin
11 27
  require 'fileutils'
12 28
  require 'tmpdir'
......
133 149
  @error = 0
134 150
  @errbuf = []
135 151
  @location = nil
152
  @exitval = nil
136 153
  pathes.each do |path|
137 154
    $stderr.print "\n#{File.basename(path)} "
138 155
    load File.expand_path(path)
......
144 161
    else
145 162
      $stderr.puts "PASS all #{@count} tests"
146 163
    end
147
    exit true
164
    @exitval = true
148 165
  else
149 166
    @errbuf.each do |msg|
150 167
      $stderr.puts msg
151 168
    end
152 169
    $stderr.puts "FAIL #{@error}/#{@count} tests failed"
153
    exit false
170
    
171
    @exitval = false
154 172
  end
173
  
174
  puts "\nTEST END, String running counter: #{String.running_counter}"
175
  
176
  exit @exitval
155 177
end
156 178

  
157 179
def assert_check(testsrc, message = '', opt = '')