Skip to content

Commit

Permalink
[Truffle] Spec for set_trace_func being optimised away - which is bro…
Browse files Browse the repository at this point in the history
…ken.
  • Loading branch information
chrisseaton committed Oct 14, 2014
1 parent 0a16107 commit 905db5f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/truffle/pe/core/kernel/set_trace_func_pe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module KernelSetTraceFuncFixtures

def self.method_with_many_lines(a, b)
x = a
y = b
z = x + y
z
end

end

PETests.tests do

describe "Kernel" do

describe "set_trace_func" do

begin
set_trace_func proc { |event, file, line, id, binding, classname|
}

broken_example "still has Fixnum#+ Fixnum" do
truffle_assert_constant KernelSetTraceFuncFixtures.method_with_many_lines(14, 2)
end
ensure
set_trace_func nil
end

end

end

end
10 changes: 10 additions & 0 deletions test/truffle/pe/pe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ def self.counter_example(description)
#end
end

def self.broken_example(description)
puts "warning: broken examples not run"
#describe "#{description} is not constant" do
# inner_example do
# yield
# end
#end
end

def self.finish
print "\n"

Expand Down Expand Up @@ -119,6 +128,7 @@ def self.inner_example
require "core/symbol_pe.rb"
require "core/array_pe.rb"
require "core/hash_pe.rb"
require "core/kernel/set_trace_func_pe.rb"
require "macro/pushing_pixels_pe.rb"

# Finished
Expand Down

0 comments on commit 905db5f

Please sign in to comment.