ci: Test whether GMP is working in compilers.yml (#10875)

Avoid reoccurence of [Bug #20515]

Requires https://github.com/ruby/ruby/pull/10876 since 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b

bug: https://bugs.ruby-lang.org/issues/20515
This commit is contained in:
Sorah Fukumori 2024-05-31 03:44:31 +09:00 committed by GitHub
parent 4f160ad9cf
commit 22e4eeda65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,4 @@
# Some tests depending on this name 'Compilations' via $GITHUB_WORKFLOW. Make sure to update such tests when renaming this workflow.
name: Compilations
on:
@ -136,7 +137,7 @@ jobs:
- { name: '-O0', env: { optflags: '-O0 -march=x86-64 -mtune=generic' } }
# - { name: '-O3', env: { optflags: '-O3 -march=x86-64 -mtune=generic' }, check: true }
- { name: gmp, env: { append_configure: '--with-gmp' } }
- { name: gmp, env: { append_configure: '--with-gmp' }, check: true }
- { name: jemalloc, env: { append_configure: '--with-jemalloc' } }
- { name: valgrind, env: { append_configure: '--with-valgrind' } }
- { name: 'coroutine=ucontext', env: { append_configure: '--with-coroutine=ucontext' } }

View File

@ -821,5 +821,11 @@ class TestBignum < Test::Unit::TestCase
assert_nil(T1024P.infinite?)
assert_nil((-T1024P).infinite?)
end
def test_gmp_version
if RbConfig::CONFIG.fetch('configure_args').include?("'--with-gmp'")
assert_equal(true, defined?(Integer::GMP_VERSION))
end
end if ENV['GITHUB_WORKFLOW'] == 'Compilations'
end
end