-
Notifications
You must be signed in to change notification settings - Fork 38.1k
tests: Add note about test suite naming convention in developer-notes.md #12719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7b4a296
5fd864f
db983be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a serious shell quoting problem here. This isn't just a nit, it changes the semantics of the test. Use test -n and quote the variable, e.g. if [ -n "${NAMING_INCONSISTENCIES}" ]; then
... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I have to take this back, apparently [[ doesn't perform word-splitting. Still scares me though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to be scared – FWIW There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't that a bash-ism, which means we'll get, as usual, at least three iterations of PRs 'fixing' this for different shells on different platforms? I'm also no use in reviewing shell scripts. Would be happier with a python script. On the other hand this is by far not the most scary one :) Concept ACK anyhow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a |
||
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 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a violation in
but I realize that is outside the scope of
test_bitcoin
tests.Could make changes upstream to
univalue
as well, but that's minor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, upstreams' tests are intentionally not checked by
lint-tests.sh
since we don't want Travis to block on things where we need help from upstreams. All violations should be possible to fix in-tree :-)