aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-04-05 22:26:12 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-04-06 16:29:14 +0200
commitd1b622b5a2dff5d68310bdf4e5d62d74e5391c25 (patch)
tree857f8e41cff02e5eb7efa354be91946a513f84b5 /contrib/devtools
parentdc8067b3e6297884a4861783bcb54a5941b271df (diff)
downloadbitcoin-d1b622b5a2dff5d68310bdf4e5d62d74e5391c25.tar.xz
tests: Add check for test suite name uniqueness in lint-tests.sh
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-xcontrib/devtools/lint-tests.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/contrib/devtools/lint-tests.sh b/contrib/devtools/lint-tests.sh
index dd1a3ebdc4..ffc0660551 100755
--- a/contrib/devtools/lint-tests.sh
+++ b/contrib/devtools/lint-tests.sh
@@ -4,7 +4,9 @@
# Distributed under the MIT software license, see the accompanying
# 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\(' -- \
"src/test/**.cpp" "src/wallet/test/**.cpp" | \
@@ -15,5 +17,18 @@ if [[ ${NAMING_INCONSISTENCIES} != "" ]]; then
echo "that convention:"
echo
echo "${NAMING_INCONSISTENCIES}"
- exit 1
+ EXIT_CODE=1
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}