tests: Separately check for rapidcheck/boost_test.h in configure #14694

pull Empact wants to merge 1 commits into bitcoin:master from Empact:rapidcheck-boost-test changing 1 files +1 −1
  1. Empact commented at 10:40 PM on November 8, 2018: member

    As per https://github.com/emil-e/rapidcheck/blob/master/doc/boost_test.md Boost Test integration is an "extra" and not guaranteed to be available alongside rapidcheck itself. Checking for it in configure.ac avoids rapidcheck being enabled when not fully available.

    On my machine, before:

      checking rapidcheck.h usability... yes
      checking rapidcheck.h presence... yes
      checking for rapidcheck.h... yes
      [...]
      CXX      wallet/test/test_test_bitcoin-psbt_wallet_tests.o
      test/key_properties.cpp:16:10: fatal error: 'rapidcheck/boost_test.h' file not found
      #include <rapidcheck/boost_test.h>
               ^~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
    

    After:

      checking rapidcheck.h usability... yes
      checking rapidcheck.h presence... yes
      checking for rapidcheck.h... yes
      checking rapidcheck/boost_test.h usability... no
      checking rapidcheck/boost_test.h presence... no
      checking for rapidcheck/boost_test.h... no
    
  2. fanquake added the label Build system on Nov 8, 2018
  3. Empact commented at 10:42 PM on November 8, 2018: member
  4. Empact force-pushed on Nov 11, 2018
  5. Empact commented at 12:32 AM on November 11, 2018: member

    Update to fix given that AC_CHECK_HEADERS runs the positive case if any of the headers are present, and the negative case if any are missing.

  6. Christewart commented at 10:20 PM on November 11, 2018: member

    This makes sense to me. Although in reality we probably want to figure out a way to cleanly install the extras package with cmake.

    utack

  7. Empact renamed this:
    tests: Check for rapidcheck/boost_test.h header on use_rapidcheck=auto
    tests: Separately check for rapidcheck/boost_test.h in configure
    on Dec 31, 2018
  8. laanwj requested review from theuni on Jan 19, 2019
  9. DrahtBot commented at 1:48 PM on August 16, 2019: member

    <!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 278 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.

  10. DrahtBot closed this on Aug 16, 2019

  11. DrahtBot reopened this on Aug 16, 2019

  12. jonatack approved
  13. jonatack commented at 4:23 PM on August 16, 2019: member

    EDIT: Suspending my initial approval. This PR improves the situation for the case when neither --with-rapidcheck nor --without-rapidcheck is passed into the configure but rapidcheck.h is detected while rapidcheck/boost_test.h is missing, and the build fails when it tries to compile test/key_properties.cpp which has an #include <rapidcheck/boost_test.h>.

    However, the PR also seems to cause a new issue: When boost_test.h is present and it runs fine when --with-rapidcheck is passed (and before this PR when no argument is passed), e.g.

    CXX      test/test_bitcoin-key_properties.o
    [...]
    Running tests: key_properties from test/key_properties.cpp
    

    then when no argument is passed to configure, the checks added in this PR return a false negative and the build does not compile rapidcheck when it otherwise should:

    checking rapidcheck.h usability... yes
    checking rapidcheck.h presence... yes
    checking for rapidcheck.h... yes
    checking rapidcheck/boost_test.h usability... no
    checking rapidcheck/boost_test.h presence... yes
    configure: WARNING: rapidcheck/boost_test.h: present but cannot be compiled
    configure: WARNING: rapidcheck/boost_test.h:     check for missing prerequisite headers?
    configure: WARNING: rapidcheck/boost_test.h: see the Autoconf documentation
    configure: WARNING: rapidcheck/boost_test.h:     section "Present But Cannot Be Compiled"
    configure: WARNING: rapidcheck/boost_test.h: proceeding with the compiler's result
    configure: WARNING:     ## -------------------------------------------------------- ##
    configure: WARNING:     ## Report this to https://github.com/bitcoin/bitcoin/issues ##
    configure: WARNING:     ## -------------------------------------------------------- ##
    

    A couple of autoconf docs, for info:

    https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Present-But-Cannot-Be-Compiled.html

    https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Generic-Headers.html#Generic-Headers

  14. tests: Check for rapidcheck/boost_test.h header on use_rapidcheck=auto
    As per https://github.com/emil-e/rapidcheck/blob/master/doc/boost_test.md
    Boost Test integration is an "extra" and not guaranteed to be available
    alongside rapidcheck itself. Checking for it in configure.ac avoids rapidcheck
    being enabled when not fully available.
    
    On my machine, before:
    
      checking rapidcheck.h usability... yes
      checking rapidcheck.h presence... yes
      checking for rapidcheck.h... yes
      [...]
      CXX      wallet/test/test_test_bitcoin-psbt_wallet_tests.o
      test/key_properties.cpp:16:10: fatal error: 'rapidcheck/boost_test.h' file not found
      #include <rapidcheck/boost_test.h>
               ^~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
    
    After:
      checking rapidcheck/boost_test.h usability... no
      checking rapidcheck/boost_test.h presence... no
      checking for rapidcheck/boost_test.h... no
    
    Note that as rapidcheck/boost_test.h includes rapidcheck.h, the default
    compile test will also effectively test rapidcheck.h for presence and
    usability.
    0a7c5f0a94
  15. Empact force-pushed on Feb 28, 2020
  16. Empact commented at 9:03 PM on February 28, 2020: member

    @jonatack could you give this another try? I changed the test to check only for rapidcheck/boost_test.h, on the theory that it's inclusion of rapidcheck.h will mean that rapidcheck/boost_test.h's compile test will also effectively test for rapidcheck.h.

  17. Christewart commented at 11:32 AM on April 3, 2020: member

    This should probably be closed as of #18514

  18. fanquake closed this on Apr 3, 2020

  19. DrahtBot locked this on Feb 15, 2022


theuni


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me