aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-03-18 19:17:34 +0100
committerpracticalswift <practicalswift@users.noreply.github.com>2018-03-19 08:54:08 +0100
commitdb983beba6fec910722bacc0d67c7ae98ba566fa (patch)
tree3b3b8578c96f8ea87413082d4db4b1f2dfdec6f1 /contrib/devtools
parent5fd864fe8a3b7c6abcfec97980ccc8f57ffdd8ca (diff)
tests: Add lint-tests.sh which checks the test suite naming convention
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-xcontrib/devtools/lint-tests.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/devtools/lint-tests.sh b/contrib/devtools/lint-tests.sh
new file mode 100755
index 0000000000..dd1a3ebdc4
--- /dev/null
+++ b/contrib/devtools/lint-tests.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2018 The Bitcoin Core developers
+# 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
+
+NAMING_INCONSISTENCIES=$(git grep -E '^BOOST_FIXTURE_TEST_SUITE\(' -- \
+ "src/test/**.cpp" "src/wallet/test/**.cpp" | \
+ grep -vE '/(.*?)\.cpp:BOOST_FIXTURE_TEST_SUITE\(\1, .*\)$')
+if [[ ${NAMING_INCONSISTENCIES} != "" ]]; then
+ echo "The test suite in file src/test/foo_tests.cpp should be named"
+ echo "\"foo_tests\". Please make sure the following test suites follow"
+ echo "that convention:"
+ echo
+ echo "${NAMING_INCONSISTENCIES}"
+ exit 1
+fi