Skip to content

Commit bc5e710

Browse files
committed
[GR-17457] Do not depend on qsort() internals in the C-ext backtraces test
PullRequest: truffleruby/3233
2 parents 825b24b + fcbcb27 commit bc5e710

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

test/truffle/cexts/backtraces/bin/backtraces

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ TEST_DIR = File.expand_path("../..", __FILE__)
55
SRC_DIR = File.expand_path("../../../../../..", __FILE__)
66

77
def puts_backtrace(backtrace)
8-
puts backtrace.gsub(Truffle::Boot.ruby_home, '')
9-
.gsub(TEST_DIR, '').gsub(SRC_DIR, '')
8+
puts backtrace.gsub(Truffle::Boot.ruby_home, '').gsub(TEST_DIR, '').gsub(SRC_DIR, '')
109
.gsub(%r{(/cext\.rb|/cext_ruby\.rb|/c/cext/\w+\.c|/qsort\.c|<internal:core> .+\.rb):(\d+:)?}, '\1:n:')
10+
.gsub(%r{.+/qsort\.c:n:in `(?!qsort)\w+'\n}, '')
1111
end
1212

1313
puts "Test error in Ruby => C ext support => Ruby"

test/truffle/cexts/backtraces/expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ Test error in the callback to the Sulong-instrinsified qsort()
3333
/bin/backtraces:74:in `block in <main>': error from Ruby called from instrinsified qsort() (RuntimeError)
3434
from /lib/truffle/truffle/cext.rb:n:in `rb_funcall'
3535
from /ext/backtraces/backtraces.c:17:in `compare_function'
36-
from com.oracle.truffle.llvm.libraries.bitcode/src/qsort.c:n:in `sift'
37-
from com.oracle.truffle.llvm.libraries.bitcode/src/qsort.c:n:in `trinkle'
3836
from com.oracle.truffle.llvm.libraries.bitcode/src/qsort.c:n:in `qsort'
3937
from /ext/backtraces/backtraces.c:25:in `call_qsort'
4038
from /lib/truffle/truffle/cext_ruby.rb:n:in `qsort'

0 commit comments

Comments
 (0)