Skip to content

Commit f280fa4

Browse files
committed
functional test fixes and no RUNPATH in linux builds
1 parent 7055c83 commit f280fa4

4 files changed

Lines changed: 42 additions & 28 deletions

File tree

ci/test/03_test_script.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,17 @@ if [ "$RUN_CHECK_DEPS" = "true" ]; then
162162
fi
163163

164164
if [ "$RUN_UNIT_TESTS" = "true" ]; then
165-
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 ))
165+
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 ))
166166
fi
167167

168168
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
169-
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}"/bin/test_elements --catch_system_errors=no -l test_suite
169+
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" "${BASE_OUTDIR}"/bin/test_elements --catch_system_errors=no -l test_suite
170170
fi
171171

172172
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
173173
# parses TEST_RUNNER_EXTRA as an array which allows for multiple arguments such as TEST_RUNNER_EXTRA='--exclude "rpc_bind.py --ipv6"'
174174
eval "TEST_RUNNER_EXTRA=($TEST_RUNNER_EXTRA)"
175-
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast
175+
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast
176176
fi
177177

178178
if [ "${RUN_TIDY}" = "true" ]; then
@@ -206,5 +206,5 @@ fi
206206

207207
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
208208
# shellcheck disable=SC2086
209-
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} "${MAKEJOBS}" -l DEBUG "${DIR_FUZZ_IN}" --empty_min_time=60
209+
LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib:${BASE_BUILD_DIR}/lib:${BASE_BUILD_DIR}/src/secp256k1/lib" test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} "${MAKEJOBS}" -l DEBUG "${DIR_FUZZ_IN}" --empty_min_time=60
210210
fi

src/CMakeLists.txt

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,11 @@ if(ENABLE_WALLET)
277277
init/bitcoin-wallet.cpp
278278
wallet/wallettool.cpp
279279
)
280-
set_target_properties(elements-wallet PROPERTIES
281-
SKIP_BUILD_RPATH OFF
282-
)
280+
if(APPLE)
281+
set_target_properties(elements-wallet PROPERTIES
282+
SKIP_BUILD_RPATH OFF
283+
)
284+
endif()
283285
add_windows_resources(elements-wallet bitcoin-wallet-res.rc)
284286
target_link_libraries(elements-wallet
285287
core_interface
@@ -421,9 +423,11 @@ if(BUILD_DAEMON)
421423
bitcoind.cpp
422424
init/bitcoind.cpp
423425
)
424-
set_target_properties(elementsd PROPERTIES
425-
SKIP_BUILD_RPATH OFF
426-
)
426+
if(APPLE)
427+
set_target_properties(elementsd PROPERTIES
428+
SKIP_BUILD_RPATH OFF
429+
)
430+
endif()
427431
add_windows_resources(elementsd bitcoind-res.rc)
428432
target_link_libraries(elementsd
429433
core_interface
@@ -438,9 +442,11 @@ if(WITH_MULTIPROCESS AND BUILD_DAEMON)
438442
bitcoind.cpp
439443
init/bitcoin-node.cpp
440444
)
441-
set_target_properties(elements-node PROPERTIES
442-
SKIP_BUILD_RPATH OFF
443-
)
445+
if(APPLE)
446+
set_target_properties(elements-node PROPERTIES
447+
SKIP_BUILD_RPATH OFF
448+
)
449+
endif()
444450
target_link_libraries(elements-node
445451
core_interface
446452
bitcoin_node
@@ -482,9 +488,11 @@ target_link_libraries(bitcoin_cli
482488
# Elements Core RPC client
483489
if(BUILD_CLI)
484490
add_executable(elements-cli bitcoin-cli.cpp)
485-
set_target_properties(elements-cli PROPERTIES
486-
SKIP_BUILD_RPATH OFF
487-
)
491+
if(APPLE)
492+
set_target_properties(elements-cli PROPERTIES
493+
SKIP_BUILD_RPATH OFF
494+
)
495+
end if()
488496
add_windows_resources(elements-cli bitcoin-cli-res.rc)
489497
target_link_libraries(elements-cli
490498
core_interface
@@ -501,9 +509,11 @@ endif()
501509
if(BUILD_TX)
502510
add_executable(elements-tx bitcoin-tx.cpp)
503511
add_windows_resources(elements-tx bitcoin-tx-res.rc)
504-
set_target_properties(elements-tx PROPERTIES
505-
SKIP_BUILD_RPATH OFF
506-
)
512+
if(APPLE)
513+
set_target_properties(elements-tx PROPERTIES
514+
SKIP_BUILD_RPATH OFF
515+
)
516+
endif()
507517
target_link_libraries(elements-tx
508518
core_interface
509519
bitcoin_common
@@ -518,9 +528,11 @@ endif()
518528
if(BUILD_UTIL)
519529
add_executable(elements-util bitcoin-util.cpp)
520530
add_windows_resources(elements-util bitcoin-util-res.rc)
521-
set_target_properties(elements-util PROPERTIES
522-
SKIP_BUILD_RPATH OFF
523-
)
531+
if(APPLE)
532+
set_target_properties(elements-util PROPERTIES
533+
SKIP_BUILD_RPATH OFF
534+
)
535+
endif()
524536
target_link_libraries(elements-util
525537
core_interface
526538
bitcoin_common
@@ -550,9 +562,11 @@ if(BUILD_UTIL_CHAINSTATE)
550562
# Relevant discussions:
551563
# - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953
552564
# - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833
553-
set_target_properties(bitcoin-chainstate PROPERTIES
554-
SKIP_BUILD_RPATH OFF
555-
)
565+
if(APPLE)
566+
set_target_properties(bitcoin-chainstate PROPERTIES
567+
SKIP_BUILD_RPATH OFF
568+
)
569+
endif()
556570
target_link_libraries(bitcoin-chainstate
557571
PRIVATE
558572
core_interface

test/functional/example_elements_code_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def run_test(self):
4545
assert len(self.nodes[0].listissuances()) == 2 # asset & reisuance token
4646

4747
self.nodes[0].generatetoaddress(1, self.nodes[0].getnewaddress(), called_by_framework=True) # confirm the tx
48-
48+
self.sync_all()
4949
issuance_addr = self.nodes[0].gettransaction(issuance_txid)['details'][0]['address']
5050
self.nodes[1].importaddress(issuance_addr)
5151

test/functional/test_framework/mempool_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ def fill_mempool(test_framework, node, *, tx_sync_fun=None):
5454
minrelayfee = node.getnetworkinfo()['relayfee']
5555

5656
tx_batch_size = 1
57-
num_of_batches = 75
57+
num_of_batches = 74
5858
# Generate UTXOs to flood the mempool
5959
# 1 to create a tx initially that will be evicted from the mempool later
60-
# 75 transactions each with a fee rate higher than the previous one
60+
# 74 transactions each with a fee rate higher than the previous one
6161
ephemeral_miniwallet = MiniWallet(node, tag_name="fill_mempool_ephemeral_wallet")
6262
test_framework.generate(ephemeral_miniwallet, 1 + num_of_batches * tx_batch_size)
6363

0 commit comments

Comments
 (0)