test: Add bitcoin-util tests (+refactors) #22270

pull MarcoFalke wants to merge 6 commits into bitcoin:master from MarcoFalke:2106-utilTestDoc changing 7 files +96 −34
  1. MarcoFalke commented at 12:51 PM on June 17, 2021: member

    bitcoin-util has no tests

    See https://marcofalke.github.io/btc_cov/total.coverage/src/bitcoin-util.cpp.gcov.html (Coverage report showing 0%)

  2. MarcoFalke force-pushed on Jun 17, 2021
  3. laanwj added the label Docs on Jun 17, 2021
  4. MarcoFalke force-pushed on Jun 17, 2021
  5. MarcoFalke force-pushed on Jun 17, 2021
  6. MarcoFalke force-pushed on Jun 17, 2021
  7. laanwj added this to the milestone 22.0 on Jun 17, 2021
  8. theStack commented at 3:32 PM on June 17, 2021: member

    Concept ACK

  9. MarcoFalke force-pushed on Jun 17, 2021
  10. jamesob approved
  11. jamesob commented at 5:04 PM on June 17, 2021: member

    ACK fa84adab8c64fd626b111cfea220bf7606fa4d53 (jamesob/ackr/22270.1.MarcoFalke.add_missing_bitcoin_util)

    Built locally and ran ./test/util/bitcoin-util-test.py and played with ./src/bitcoin-util grind.

    Changes look fine. Some nice import cleanups and minor code simplification.

    <details><summary>Show signature data</summary> <p>

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK fa84adab8c64fd626b111cfea220bf7606fa4d53 ([`jamesob/ackr/22270.1.MarcoFalke.add_missing_bitcoin_util`](https://github.com/jamesob/bitcoin/tree/ackr/22270.1.MarcoFalke.add_missing_bitcoin_util))
    
    Built locally and ran ./test/util/bitcoin-util-test.py and played with `./src/bitcoin-util grind`. 
    
    Changes look fine. Some nice import cleanups and minor code simplification.
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAEBCgAdFiEEGNRVI1NPYuZCSIrGepNdrbLETwUFAmDLgGsACgkQepNdrbLE
    TwWFIxAAkDsuAmOwatxePesAqX4Y40jueFJRKhoZ6wgigxoV965S42AVxPQEOKeV
    2M1LX0pLH5k4J1KkJuBPPh0SX+NNq4jRFAmOI2QYMXMaqK/qurPO/JTObT/M/YEZ
    wVTl8wK7UJPesE71yf2KxtPgBv5bl+38HLa12S8+sZahpJ5e+sis+qXnDhEnod+o
    Ljxi+36AvbVussuOkqbJoUxku6LfvCReQd4ilYww/9nuPT2r7fz5G7YehI95+QdR
    u5j0xynvai0WvJDrLonZjcRfoCHOdQDZ16BDxvqyvLtlMdA0Jehh2YzK/4MQ3tWb
    6JIDmHffNgTKUeEz5AE2X+PRDfVaqqFAJ0GtnrwYq6/tk6NXyJ5xkjHqW9QUwU6W
    TIZC7E6zBWE9vHByLz4mh2ziFLGqJbVZSMJwkeOzqE+OPurOnDzcVPVgiJlVOklD
    odmJwCCziQIGBFGTL2+BsEexqwMtnaUOJMOm84UlAMyrWMb7SBnyKKka4FtsAnVf
    UbHJzckvPSCaQ6k0HNItzGfiqvSeQfzWbYhKJPe1MG1LwXVxHhRDuOpr7EC17IsC
    Qc61guZ/U0Go3lmAQgnV/EHqea0XeeuD452pZizt/Qw/417b+JGbRjj0bknUx70b
    KSW8JxPuyuoyA3ZZ8QIq2ZmWlLhpzRM6L5dKClxKteFwGv1iI54=
    =q1fJ
    -----END PGP SIGNATURE-----
    
    

    </p></details>

    <details><summary>Show platform data</summary> <p>

    Tested on Linux-4.19.0-16-amd64-x86_64-with-glibc2.28
    
    Configured with ./configure LDFLAGS=-L/home/james/src/bitcoin2/db4/lib/ CPPFLAGS=-I/home/james/src/bitcoin2/db4/include/ CXXFLAGS=-fPIE -pipe -O2 -g -Wthread-safety-analysis -Wall -Werror=sign-compare -Wsign-compare -Werror=thread-safety-analysis --enable-wallet --enable-debug --with-daemon --enable-natpmp-default
    
    Compiled with /usr/bin/ccache /usr/local/bin/clang++ -std=c++17 -mavx -mavx2 -fPIE -pipe -O2 -g -Wthread-safety-analysis -Wall -Werror=sign-compare -Wsign-compare -Werror=thread-safety-analysis -O0 -g3 -ftrapv -fdebug-prefix-map=$(abs_srcdir)=.  -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -msse4 -msha -msse4.1 -msse4.2  i
    
    Compiler version: Debian clang version 11.1.0-++20210405104510+1fdec59bffc1-1~exp1~20210405085125.161
    

    </p></details>

  12. jamesob commented at 5:07 PM on June 17, 2021: member
  13. laanwj added the label Tests on Jun 17, 2021
  14. DrahtBot commented at 6:07 PM on June 17, 2021: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  15. practicalswift commented at 7:54 PM on June 17, 2021: contributor

    Concept ACK

  16. MarcoFalke force-pushed on Jun 17, 2021
  17. MarcoFalke renamed this:
    Add missing bitcoin-util help doc and tests
    test: Add bitcoin-util tests
    on Jun 17, 2021
  18. MarcoFalke removed the label Docs on Jun 17, 2021
  19. MarcoFalke renamed this:
    test: Add bitcoin-util tests
    test: Add bitcoin-util tests (+refactors)
    on Jun 17, 2021
  20. build_msvc: Add bitcoin-util.exe fa831e709a
  21. test: Add bitcoin-util tests fa304929e2
  22. Remove unused includes from bitcoin-util fa3c1eee7f
  23. Remove unused OptionsCategory arg from AddCommand fa751a47ff
  24. Remove gArgs from AppInitUtil
    Also fix incorrect {}
    fa08bc288f
  25. refactor: Pass grind args vector as const reference fa4017e7a0
  26. MarcoFalke force-pushed on Jun 18, 2021
  27. MarcoFalke commented at 6:15 PM on June 18, 2021: member

    Rebased due to silent merge conflict

  28. klementtan approved
  29. klementtan commented at 10:04 AM on June 19, 2021: contributor

    Code review and tested ACK fa4017e7a0899959b2ac84bcbc3f34dfb17b5fce

    <details> <summary> Tested with: </summary>

    $ ./src/bitcoin-util -signet grind 00000020c9bd670f98b2fd23e609e831221b8fe9f8b9493956778bfc61674fa86d000000300eba3aca1b6ffe05d28bb9ccc37341911943effb9985df89bb0161e3436ef0d0bccd60a569011e95b32301
    00000020c9bd670f98b2fd23e609e831221b8fe9f8b9493956778bfc61674fa86d000000300eba3aca1b6ffe05d28bb9ccc37341911943effb9985df89bb0161e3436ef0d0bccd60a569011e95b32301
    
    $ ./src/bitcoin-util -version
    Bitcoin Core bitcoin-util utility version v21.99.0-fa4017e7a089
    
    $ ./src/bitcoin-util -help
    Bitcoin Core bitcoin-util utility version v21.99.0-fa4017e7a089
    ...(help man)
    

    </deatils>

  30. theStack approved
  31. theStack commented at 9:08 AM on June 20, 2021: member

    Tested ACK fa4017e7a0899959b2ac84bcbc3f34dfb17b5fce (modulo first commit fa831e709a4d605a18e5de1627b48d670bb326fb, as I don't have a Windows / Visual Studio environment)

    Reviewed the code changes, built locally, ran the introduced tests and grinded some early signet block headers, works as expected.

  32. MarcoFalke commented at 9:30 AM on June 20, 2021: member

    (modulo first commit fa831e7, as I don't have a Windows / Visual Studio environment)

    I don't have Windows either, but the commit was required for the tests to pass on appveyor CI

  33. jamesob approved
  34. jamesob commented at 8:42 PM on June 23, 2021: member

    reACK fa4017e7a0899959b2ac84bcbc3f34dfb17b5fce (jamesob/ackr/22270.1.MarcoFalke.test_add_bitcoin_util_te)

    Built locally, ran bitcoin-util tests.

    <details><summary>Show signature data</summary> <p>

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    reACK fa4017e7a0899959b2ac84bcbc3f34dfb17b5fce ([`jamesob/ackr/22270.1.MarcoFalke.test_add_bitcoin_util_te`](https://github.com/jamesob/bitcoin/tree/ackr/22270.1.MarcoFalke.test_add_bitcoin_util_te))
    
    Built locally, ran bitcoin-util tests.
    -----BEGIN PGP SIGNATURE-----
    
    iQIzBAEBCgAdFiEEGNRVI1NPYuZCSIrGepNdrbLETwUFAmDTnJkACgkQepNdrbLE
    TwWViQ/6ArDUV5umNaPEu2IPKwTC4h1sExbyxZW7x/JQmG0qWWrENWLpl4kAqXFx
    fh4wYd1OhQyTI6RB3pNnnLLzZOjlgTi3pZ2ufLsp+WKcYbRMBxOagveMj3700ju2
    lSNaYnwvw5viFhBvHMnRRQHrCMRlHqC1cOZoLnktrFeF1P1wTGvfQUCE0siwAXaB
    9sNOhoncX8SDwS4g29MdKy6geCTwPeXXbd3kkZUxxGoXTfz0hutD1p7rcHhrWj1/
    zJTGepQmI+dinZDm3sWKdwgYPWrzGUAgNnxntpFevjWgI51KpSpN77HBPzy2RBZm
    qear5Vku2W+M7x9Lt0sjPG3o10kQzzUFPpVYSueb0GqAdCHSdUDrko05TfBtj+/a
    0QOlIl6UxN1oNrDLIbtUpFb+1HNsTfYmpeMe1ajXS/m2UsgH0V32hq85VFpcCzmv
    0AGeLIqvg+9xNXH0I2/3Ldkexvb+BerZzCd188jxjnnEj6W7FuOlInVCexz7/GIq
    W71CTM+xk4PPQim9eJOO5gEc4RMbKZvSqQ4ctQaU3v54+iyq/EO3hz9+4/D3VTnt
    zYRkkjViU9h3z3sK1Ebl0d8wj1E87FOSR2EN7qieUd9t6yQa1u485ySGDu30CUnx
    d9O+//Jz5wqzTYupF+zU//98CiPj3XNfS8wfqichkYg5epsDvs0=
    =nBk0
    -----END PGP SIGNATURE-----
    
    

    </p></details>

    <details><summary>Show platform data</summary> <p>

    Tested on Linux-4.19.0-17-amd64-x86_64-with-glibc2.28
    
    Configured with ./configure LDFLAGS=-L/home/james/src/bitcoin/db4/lib/ CPPFLAGS=-I/home/james/src/bitcoin/db4/include/ CXXFLAGS=-fPIE -pipe -O2 -g -Wthread-safety-analysis -Wall -Werror=sign-compare --enable-wallet --with-daemon CXX=/usr/local/bin/clang++ CC=/usr/local/bin/clang --with-bignum=no PYTHONPATH= --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig --enable-experimental --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --enable-module-schnorrsig --enable-experimental --no-create --no-recursion
    
    Compiled with /usr/bin/ccache /usr/local/bin/clang++ -std=c++17 -mavx -mavx2 -fPIE -pipe -O2 -g -Wthread-safety-analysis -Wall -Werror=sign-compare -fdebug-prefix-map=$(abs_srcdir)=.  -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -msse4 -msha -msse4.1 -msse4.2  i
    
    Compiler version: Debian clang version 11.1.0-++20210428103820+1fdec59bffc1-1~exp1~20210428204437.162
    

    </p></details>

  35. MarcoFalke merged this on Jun 24, 2021
  36. MarcoFalke closed this on Jun 24, 2021

  37. MarcoFalke deleted the branch on Jun 24, 2021
  38. sidhujag referenced this in commit be51318af6 on Jun 24, 2021
  39. gwillen referenced this in commit bb8e5d1ce4 on Jun 1, 2022
  40. DrahtBot locked this on Aug 16, 2022

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-17 06:14 UTC

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