Skip to content

Commit 553cf61

Browse files
committed
Merge pull request #2187 from dmarcotte/test-profiler
Fix JsonProfilePrinter
2 parents 26bbb31 + fe09269 commit 553cf61

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

core/src/main/java/org/jruby/runtime/profile/builtin/ProfilePrinter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void printHeader(PrintStream out) { }
9898
public void printFooter(PrintStream out) { }
9999

100100
public void printProfile(PrintStream out) {
101-
printProfile(out, false);
101+
printProfile(out, true);
102102
}
103103

104104
public abstract void printProfile(PrintStream out, boolean first) ;

rakelib/test.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace :test do
2222
short_tests_19 = short_tests_18.map {|test| test + "19"}
2323
short_tests = short_tests_18 + short_tests_19
2424
long_tests_18 = short_tests_18 + ['spec:ji', 'spec:compiler', 'spec:ffi', 'spec:regression']
25-
long_tests_19 = long_tests_18.map {|test| test + "19"}
25+
long_tests_19 = long_tests_18.map {|test| test + "19"} + ['spec:profiler19']
2626
slow_tests = ['test:slow', 'test:objectspace']
2727
long_tests = ['test:tracing'] + long_tests_18 + long_tests_19 + slow_tests
2828
all_tests_18 = long_tests_18.map {|test| test + ':all'}

spec/profiler/json_profile_printer_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
end
1010

1111
it 'contains only the top invocation' do
12-
json_output['methods'].should have(1).items
12+
json_output['methods'].length.should equal(1)
1313
json_output['methods'].first['name'].should == '(top)'
1414
end
1515

@@ -53,7 +53,7 @@
5353
end
5454

5555
it 'contains data on the calls from parents, including calls, total, self and child time' do
56-
method_invocation['parents'].should have(1).item
56+
method_invocation['parents'].length.should equal(1)
5757
call_data = method_invocation['parents'].find { |c| c['id'] == top_invocation['id'] }
5858
call_data.should include('total_calls' => 1, 'total_time' => anything, 'self_time' => anything, 'child_time' => anything)
5959
end

spec/profiler/runtime_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
check_passed_spec @runtime.evalScriptlet("RSpec::Core::Runner.run([ 'spec/profiler/graph_profile_printer_spec.rb' ], ERR_IO, OUT_IO)")
3636
end
3737

38-
def check_passed_spec(outcome)
38+
def check_passed_spec(exit_status)
3939
# print any errors if occured :
4040
@runtime.evalScriptlet("puts ERR_IO.string unless ERR_IO.string.empty?")
41-
passed = (outcome.to_s.should == true.to_s)
41+
passed = (exit_status == 0)
4242
ensure
4343
unless passed
4444
puts "spec not passed, output: \n"

0 commit comments

Comments
 (0)