mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
tests: Add lint-tests.sh which checks the test suite naming convention
This commit is contained in:
parent
5fd864fe8a
commit
db983beba6
19
contrib/devtools/lint-tests.sh
Executable file
19
contrib/devtools/lint-tests.sh
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user