build: Create test utility library from src/test/util/ #17401

issue MarcoFalke openend this issue on November 7, 2019
  1. MarcoFalke commented at 1:09 pm on November 7, 2019: member

    The purpose of the good first issue label is to highlight which issues are suitable for a new contributor without a deep understanding of the codebase.

    Useful skills

    • Experience with autotools build systems

    Task

    The test utility library in https://github.com/bitcoin/bitcoin/tree/master/src/test/util is currently only a folder and each module in there is compiled for each target that uses it. For example, setup_common is compiled 27 times (for the fuzz suite) and another 3 times for the other tests (bench, unit test, gui). To speed up the compilation and clarify build dependencies, this folder should be transformed into an actual library.

    Because our test binaries should test as much as possible, this library may depend on any Bitcoin Core library or third party library (except boost-unit-test). It should be built when at least one target that requires it is built, skipped otherwise.

    Want to work on this issue?

    You do not need to request permission to start working on this. You are encouraged to comment on the issue if you are planning to work on it. This will help other contributors monitor which issues are actively being addressed and is also an effective way to request assistance if and when you need it.

    For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

  2. MarcoFalke added the label good first issue on Nov 7, 2019
  3. MarcoFalke added the label Build system on Nov 7, 2019
  4. MarcoFalke added the label Tests on Nov 7, 2019
  5. brakmic commented at 7:54 pm on November 20, 2019: contributor

    Hi,

    I’ve started working on this. Not sure if I understood the goals correctly (and if I should write anything here), but I can at least generate a static lib based on src/test/util sources. I’ve also removed the many src/util/test headers from Makefile.test.include, because I don’t need them anymore to compile individual tests. Instead, I’ve put into each test’s LDADD the libtest_util.a, that is $(LIBTEST_UTIL). However, I’m not quite sure if this is the correct way to do it.

    There’s also a new Makefile.test_util.include.

    Not sure if another Makefile would be allowed, but before I expand the already existing (and complex) ones, I think a small, separate Makefile is better.

    Here the link to the commit in my forked repo: https://github.com/brakmic/bitcoin/commit/3f4b5e3a0b93c6b528bf707fd38eb63c0e29efa9

    I’m working on macOS Catalina 10.15.1 with clang 9.0.0.

    Regards,

  6. MarcoFalke commented at 8:08 pm on November 20, 2019: member
    Overall looks good, but the bench and gui tests are not using it?
  7. brakmic commented at 8:23 pm on November 20, 2019: contributor

    Thanks! I’ve included the missing references in bench & qttest.

    Here’s the commit: https://github.com/brakmic/bitcoin/commit/03002e3683c05dbd769efc7b2df206e0798bab3a

    I’ve compiled bench/qttest and could execute them.

  8. brakmic commented at 8:24 pm on November 20, 2019: contributor
    Oops, have forgotten to remove TEST_BITCOIN_H. Will do it now.
  9. brakmic commented at 8:28 pm on November 20, 2019: contributor
  10. MarcoFalke commented at 8:33 pm on November 20, 2019: member
    Ok, looks like you can open a pull request to get more review on it :+1:
  11. brakmic commented at 8:34 pm on November 20, 2019: contributor
    Many thanks. Will look into contribution guide first. ;)
  12. MarcoFalke referenced this in commit b983e7e172 on Nov 22, 2019
  13. MarcoFalke closed this on Nov 22, 2019

  14. MarcoFalke locked this on Dec 16, 2021

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: 2024-11-17 15:12 UTC

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