Skip to content

Commit

Permalink
Add more ASan tests and fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Dec 22, 2024
1 parent b95c47b commit 5fa916d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- name: Fix kernel mmap rnd bits for ASan
run: sudo sysctl vm.mmap_rnd_bits=28
- name: test with AddressSanitizer
run: rake docker_test_asan
20 changes: 20 additions & 0 deletions test/asan_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@
require 'minitest/autorun'
require_relative 'support/compare_rubies'

TESTS_THAT_RUN = %w[
test/natalie/enumerator_test.rb
].freeze

describe 'ASAN tests' do
include CompareRubies

Dir.chdir File.expand_path('..', __dir__)

TESTS_THAT_RUN.each do |path|
describe path do
it 'it runs without warnings' do
out = run_nat(path)
expect(out).wont_match(/ASan/)
end
end
end

describe 'examples/hello.rb' do
it 'it runs without warnings' do
out = run_nat('examples/hello.rb')
Expand All @@ -25,4 +38,11 @@
expect(out).wont_match(/ASan/)
end
end

describe 'examples/boardslam.rb' do
it 'it runs without warnings' do
out = run_nat('examples/boardslam.rb', 3, 5, 1)
expect(out).wont_match(/ASan/)
end
end
end

0 comments on commit 5fa916d

Please sign in to comment.