separated CC tests execution
This commit is contained in:
90
qa/pull-tester/cc-tests.sh
Executable file
90
qa/pull-tester/cc-tests.sh
Executable file
@@ -0,0 +1,90 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e -o pipefail
|
||||||
|
|
||||||
|
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}
|
||||||
|
|
||||||
|
#Run the tests
|
||||||
|
|
||||||
|
testScripts=(
|
||||||
|
'cryptoconditions_channels.py'
|
||||||
|
'cryptoconditions_dice.py'
|
||||||
|
'cryptoconditions_faucet.py'
|
||||||
|
'cryptoconditions_gateways.py'
|
||||||
|
'cryptoconditions_oracles.py'
|
||||||
|
'cryptoconditions_rewards.py'
|
||||||
|
'cryptoconditions_token.py'
|
||||||
|
);
|
||||||
|
|
||||||
|
if [ "x$ENABLE_ZMQ" = "x1" ]; then
|
||||||
|
testScripts+=('zmq_test.py')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x$ENABLE_PROTON" = "x1" ]; then
|
||||||
|
testScripts+=('proton_test.py')
|
||||||
|
fi
|
||||||
|
|
||||||
|
extArg="-extended"
|
||||||
|
passOn=${@#$extArg}
|
||||||
|
|
||||||
|
successCount=0
|
||||||
|
declare -a failures
|
||||||
|
|
||||||
|
function runTestScript
|
||||||
|
{
|
||||||
|
local testName="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
echo -e "=== Running testscript ${testName} ==="
|
||||||
|
|
||||||
|
if eval "$@"
|
||||||
|
then
|
||||||
|
successCount=$(expr $successCount + 1)
|
||||||
|
echo "--- Success: ${testName} ---"
|
||||||
|
else
|
||||||
|
failures[${#failures[@]}]="$testName"
|
||||||
|
echo "!!! FAIL: ${testName} !!!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
|
||||||
|
for (( i = 0; i < ${#testScripts[@]}; i++ ))
|
||||||
|
do
|
||||||
|
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
|
||||||
|
then
|
||||||
|
runTestScript \
|
||||||
|
"${testScripts[$i]}" \
|
||||||
|
"${BUILDDIR}/qa/rpc-tests/${testScripts[$i]}" \
|
||||||
|
--srcdir "${BUILDDIR}/src" ${passOn}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
|
||||||
|
do
|
||||||
|
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
|
||||||
|
then
|
||||||
|
runTestScript \
|
||||||
|
"${testScriptsExt[$i]}" \
|
||||||
|
"${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]}" \
|
||||||
|
--srcdir "${BUILDDIR}/src" ${passOn}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -e "\n\nTests completed: $(expr $successCount + ${#failures[@]})"
|
||||||
|
echo "successes $successCount; failures: ${#failures[@]}"
|
||||||
|
|
||||||
|
if [ ${#failures[@]} -gt 0 ]
|
||||||
|
then
|
||||||
|
echo -e "\nFailing tests: ${failures[*]}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
|
||||||
|
fi
|
||||||
@@ -14,6 +14,8 @@ You can run a single test by calling `qa/pull-tester/rpc-tests.sh <testname>`.
|
|||||||
|
|
||||||
Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`.
|
Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`.
|
||||||
|
|
||||||
|
Also it's possible to run CryptoConditions tests only by `qa/pull-tester/cc-tests.sh`
|
||||||
|
|
||||||
Possible options:
|
Possible options:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user