Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Copyright (c) The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or http://www.opensource.org/licenses/mit-license.php.5# Custom test targets for convenience, based on6# https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/EmulateMakeCheck.7#8# CTest already provides a "make test" target, but it just runs existing tests9# that were previously built, without building anything itself. Define "make10# tests" here as a custom target to build all available tests and "make check"11# as a custom target to build and run them.12add_custom_target(mptests)13add_custom_target(mpcheck COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS mptests)15# Only add more convenient tests and check targets if project is being built16# standalone, to prevent clashes with external projects.17if (MP_STANDALONE)18add_custom_target(tests DEPENDS mptests)19add_custom_target(check DEPENDS mpcheck)20endif()22if(BUILD_TESTING AND TARGET CapnProto::kj-test)23set_property(SOURCE ${MP_PROXY_HDRS} PROPERTY GENERATED 1)25add_executable(mptest26${MP_PROXY_HDRS}27mp/test/foo-types.h28mp/test/foo.h29mp/test/listen_tests.cpp30mp/test/spawn_tests.cpp31mp/test/test.cpp32)33include(${PROJECT_SOURCE_DIR}/cmake/TargetCapnpSources.cmake)34target_capnp_sources(mptest ${CMAKE_CURRENT_SOURCE_DIR} mp/test/foo.capnp)35target_include_directories(mptest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})36target_link_libraries(mptest PRIVATE CapnProto::kj-test)37target_link_libraries(mptest PRIVATE Threads::Threads)39add_dependencies(mptests mptest)40add_test(NAME mptest COMMAND mptest)41endif()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.