Skip to content

Commit d1b622b

Browse files
tests: Add check for test suite name uniqueness in lint-tests.sh
1 parent dc8067b commit d1b622b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

contrib/devtools/lint-tests.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# Distributed under the MIT software license, see the accompanying
55
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
66
#
7-
# Check the test suite naming convention
7+
# Check the test suite naming conventions
8+
9+
EXIT_CODE=0
810

911
NAMING_INCONSISTENCIES=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \
1012
"src/test/**.cpp" "src/wallet/test/**.cpp" | \
@@ -15,5 +17,18 @@ if [[ ${NAMING_INCONSISTENCIES} != "" ]]; then
1517
echo "that convention:"
1618
echo
1719
echo "${NAMING_INCONSISTENCIES}"
18-
exit 1
20+
EXIT_CODE=1
1921
fi
22+
23+
TEST_SUITE_NAME_COLLISSIONS=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \
24+
"src/test/**.cpp" "src/wallet/test/**.cpp" | cut -f2 -d'(' | cut -f1 -d, | \
25+
sort | uniq -d)
26+
if [[ ${TEST_SUITE_NAME_COLLISSIONS} != "" ]]; then
27+
echo "Test suite names must be unique. The following test suite names"
28+
echo "appear to be used more than once:"
29+
echo
30+
echo "${TEST_SUITE_NAME_COLLISSIONS}"
31+
EXIT_CODE=1
32+
fi
33+
34+
exit ${EXIT_CODE}

0 commit comments

Comments
 (0)