mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
tests: Add check for test suite name uniqueness in lint-tests.sh
This commit is contained in:
parent
dc8067b3e6
commit
d1b622b5a2
@ -4,7 +4,9 @@
|
|||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
#
|
#
|
||||||
# Check the test suite naming convention
|
# Check the test suite naming conventions
|
||||||
|
|
||||||
|
EXIT_CODE=0
|
||||||
|
|
||||||
NAMING_INCONSISTENCIES=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \
|
NAMING_INCONSISTENCIES=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \
|
||||||
"src/test/**.cpp" "src/wallet/test/**.cpp" | \
|
"src/test/**.cpp" "src/wallet/test/**.cpp" | \
|
||||||
@ -15,5 +17,18 @@ if [[ ${NAMING_INCONSISTENCIES} != "" ]]; then
|
|||||||
echo "that convention:"
|
echo "that convention:"
|
||||||
echo
|
echo
|
||||||
echo "${NAMING_INCONSISTENCIES}"
|
echo "${NAMING_INCONSISTENCIES}"
|
||||||
exit 1
|
EXIT_CODE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
TEST_SUITE_NAME_COLLISSIONS=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \
|
||||||
|
"src/test/**.cpp" "src/wallet/test/**.cpp" | cut -f2 -d'(' | cut -f1 -d, | \
|
||||||
|
sort | uniq -d)
|
||||||
|
if [[ ${TEST_SUITE_NAME_COLLISSIONS} != "" ]]; then
|
||||||
|
echo "Test suite names must be unique. The following test suite names"
|
||||||
|
echo "appear to be used more than once:"
|
||||||
|
echo
|
||||||
|
echo "${TEST_SUITE_NAME_COLLISSIONS}"
|
||||||
|
EXIT_CODE=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit ${EXIT_CODE}
|
||||||
|
Loading…
Reference in New Issue
Block a user