diff options
author | Sorah Fukumori <[email protected]> | 2024-05-31 03:44:31 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-30 18:44:31 +0000 |
commit | 22e4eeda6561693367fc7a00b92b90f46b09cabd (patch) | |
tree | 0f77bf3f3d3438471d86cc5d43ac46fee9459381 | |
parent | 4f160ad9cfc0f2690a5acca301dedff4f901a673 (diff) |
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
-rw-r--r-- | .github/workflows/compilers.yml | 3 | ||||
-rw-r--r-- | test/ruby/test_bignum.rb | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 8937a5b15f..85769bd879 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -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' } } diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb index 1f882c6cb9..0179a3c630 100644 --- a/test/ruby/test_bignum.rb +++ b/test/ruby/test_bignum.rb @@ -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 |