mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
7be2b2456a
fa3c910bfeab00703c947c5200a64c21225b50ef test: Move linters to test/lint, add readme (MarcoFalke) Pull request description: This moves the checks and linters from `devtools` to a subfolder in `test`. (Motivated by my opinion that the dev tools are mostly for generating code and updating the repo whereas the linters are read-only checks.) Also, adds a readme to clarify that checks and linters are only meant to prevent bugs and user facing issues, not merely stylistic preference or inconsistencies. (This is motivated by the diversity in developers and work flows as well as existing code styles. It would be too disruptive to change all existing code to a single style or too burdensome to force all developers to adhere to a single style. Also note that our style guide is changing, so locking in at the wrong style "too early" would only waste resources.) Tree-SHA512: 9b10e89f2aeaf0c8a9ae248aa891d74e0abf0569f8e5dfd266446efa8bfaf19f0ea0980abf0b0b22f0d8416ee90d7435d21a9f9285b66df43f370b7979173406
36 lines
1.2 KiB
Bash
Executable File
36 lines
1.2 KiB
Bash
Executable File
#!/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 conventions
|
|
|
|
export LC_ALL=C
|
|
EXIT_CODE=0
|
|
|
|
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_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}
|