2014-10-30 19:58:13 -07:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
CURDIR=$(cd $(dirname "$0"); pwd)
|
|
|
|
# Get BUILDDIR and REAL_BITCOIND
|
|
|
|
. "${CURDIR}/tests-config.sh"
|
|
|
|
|
|
|
|
export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli
|
|
|
|
export BITCOIND=${REAL_BITCOIND}
|
|
|
|
|
2014-11-17 11:08:08 -08:00
|
|
|
if [ "x${EXEEXT}" = "x.exe" ]; then
|
|
|
|
echo "Win tests currently disabled"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2014-10-30 19:58:13 -07:00
|
|
|
#Run the tests
|
|
|
|
|
2014-12-09 08:31:23 -08:00
|
|
|
testScripts=(
|
|
|
|
'wallet.py'
|
|
|
|
'listtransactions.py'
|
|
|
|
'mempool_resurrect_test.py'
|
|
|
|
'txn_doublespend.py'
|
|
|
|
'txn_doublespend.py --mineblock'
|
|
|
|
'getchaintips.py'
|
2015-03-23 10:16:07 -07:00
|
|
|
'rawtransactions.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
'rest.py'
|
|
|
|
'mempool_spendcoinbase.py'
|
|
|
|
'mempool_coinbase_spends.py'
|
|
|
|
'httpbasics.py'
|
2015-01-07 02:21:53 -08:00
|
|
|
'zapwallettxes.py'
|
2015-04-17 10:26:03 -07:00
|
|
|
'proxy_test.py'
|
2015-02-03 17:59:41 -08:00
|
|
|
'merkle_blocks.py'
|
2015-03-23 10:16:07 -07:00
|
|
|
'signrawtransactions.py'
|
2015-05-02 04:15:26 -07:00
|
|
|
);
|
|
|
|
testScriptsExt=(
|
|
|
|
'bipdersig-p2p.py'
|
|
|
|
'bipdersig.py'
|
|
|
|
'getblocktemplate_longpoll.py'
|
|
|
|
'getblocktemplate_proposals.py'
|
2015-05-02 04:58:10 -07:00
|
|
|
'pruning.py'
|
2015-05-02 04:15:26 -07:00
|
|
|
'forknotify.py'
|
|
|
|
'invalidateblock.py'
|
|
|
|
'keypool.py'
|
|
|
|
'receivedby.py'
|
|
|
|
'reindex.py'
|
|
|
|
'rpcbind_test.py'
|
|
|
|
'script_test.py'
|
|
|
|
'smartfees.py'
|
2015-04-28 09:36:15 -07:00
|
|
|
'maxblocksinflight.py'
|
2015-04-28 09:39:47 -07:00
|
|
|
'invalidblockrequest.py'
|
2015-04-01 06:08:00 -07:00
|
|
|
'rawtransactions.py'
|
|
|
|
# 'forknotify.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
);
|
2015-05-02 04:58:10 -07:00
|
|
|
|
|
|
|
extArg="-extended"
|
|
|
|
passOn=${@#$extArg}
|
|
|
|
|
2014-10-30 19:58:13 -07:00
|
|
|
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
|
2014-12-09 08:31:23 -08:00
|
|
|
for (( i = 0; i < ${#testScripts[@]}; i++ ))
|
|
|
|
do
|
2015-05-02 04:58:10 -07:00
|
|
|
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
|
2014-12-09 08:31:23 -08:00
|
|
|
then
|
2015-01-07 02:21:53 -08:00
|
|
|
echo -e "Running testscript \033[1m${testScripts[$i]}...\033[0m"
|
2015-05-02 04:58:10 -07:00
|
|
|
${BUILDDIR}/qa/rpc-tests/${testScripts[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
|
2014-12-09 08:31:23 -08:00
|
|
|
fi
|
|
|
|
done
|
2015-05-02 04:15:26 -07:00
|
|
|
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
|
|
|
|
do
|
2015-05-02 04:58:10 -07:00
|
|
|
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
|
2015-05-02 04:15:26 -07:00
|
|
|
then
|
2015-05-02 04:58:10 -07:00
|
|
|
echo -e "Running \033[1m2nd level\033[0m testscript \033[1m${testScriptsExt[$i]}...\033[0m"
|
|
|
|
${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
|
2015-05-02 04:15:26 -07:00
|
|
|
fi
|
|
|
|
done
|
2014-10-30 19:58:13 -07:00
|
|
|
else
|
|
|
|
echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
|
|
|
|
fi
|