diff --git a/.arclint b/.arclint index 083780837b..7bb98b2b62 100644 --- a/.arclint +++ b/.arclint @@ -1,185 +1,185 @@ { "linters": { "generated": { "type": "generated" }, "clang-format": { "type": "clang-format", "version": ">=8.0", "bin": ["clang-format-8", "clang-format"], "include": "(^src/.*\\.(h|c|cpp|mm)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" ] }, "autopep8": { "type": "autopep8", "version": ">=1.3.4", "include": "(\\.py$)" }, "flake8": { "type": "flake8", "include": "(\\.py$)", "flags": [ "--select=E112,E113,E115,E116,E125,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E741,E742,E743,E901,E902,F401,F402,F403,F404,F405,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W292,W293,W601,W602,W603,W604,W605,W606" ] }, "lint-format-strings": { "type": "lint-format-strings", "include": "(^src/.*\\.(h|c|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" ] }, "check-doc": { "type": "check-doc", "include": "(^src/.*\\.(h|c|cpp)$)" }, "lint-tests": { "type": "lint-tests", - "include": "(^src/(rpc/|wallet/)?test/.*\\.(cpp)$)" + "include": "(^src/(seeder/|rpc/|wallet/)?test/.*\\.(cpp)$)" }, "lint-python-format": { "type": "lint-python-format", "include": "(\\.py$)", "exclude": [ "(^test/lint/lint-python-format\\.py$)" ] }, "phpcs": { "type": "phpcs", "include": "(\\.php$)", "exclude": [ "(^arcanist/__phutil_library_.+\\.php$)" ], "phpcs.standard": "arcanist/phpcs.xml" }, "lint-locale-dependence": { "type": "lint-locale-dependence", "include": "(^src/.*\\.(h|cpp)$)", "exclude": [ "(^src/(crypto/ctaes/|leveldb/|secp256k1/|seeder/|tinyformat.h|univalue/))" ] }, "lint-cheader": { "type": "lint-cheader", "include": "(^src/.*\\.(h|cpp)$)", "exclude": [ "(^src/(crypto/ctaes|secp256k1|univalue|leveldb)/)" ] }, "spelling": { "type": "spelling", "exclude": [ "(^build-aux/m4/)", "(^depends/)", "(^doc/release-notes/)", "(^src/(qt/locale|secp256k1|univalue|leveldb)/)", "(^test/lint/dictionary/)" ], "spelling.dictionaries": [ "test/lint/dictionary/english.json" ] }, "lint-assert-with-side-effects": { "type": "lint-assert-with-side-effects", "include": "(^src/.*\\.(h|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" ] }, "lint-include-quotes": { "type": "lint-include-quotes", "include": "(^src/.*\\.(h|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" ] }, "lint-include-guard": { "type": "lint-include-guard", "include": "(^src/.*\\.h$)", "exclude": [ "(^src/(crypto/ctaes|secp256k1|univalue|leveldb)/)", "(^src/tinyformat.h$)" ] }, "lint-include-source": { "type": "lint-include-source", "include": "(^src/.*\\.(h|c|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" ] }, "lint-stdint": { "type": "lint-stdint", "include": "(^src/.*\\.(h|c|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)", "(^src/compat/assumptions.h$)" ] }, "lint-source-filename": { "type": "lint-source-filename", "include": "(^src/.*\\.(h|c|cpp)$)", "exclude": [ "(^src/(secp256k1|univalue|leveldb)/)" ] }, "lint-boost-dependencies": { "type": "lint-boost-dependencies", "include": "(^src/.*\\.(h|cpp)$)" }, "check-rpc-mappings": { "type": "check-rpc-mappings", "include": "(^src/(rpc/|wallet/rpc).*\\.cpp$)" }, "lint-python-encoding": { "type": "lint-python-encoding", "include": "(\\.py$)" }, "lint-python-shebang": { "type": "lint-python-shebang", "include": "(\\.py$)", "exclude": [ "(__init__\\.py$)" ] }, "lint-bash-shebang": { "type": "lint-bash-shebang", "include": "(\\.sh$)" }, "shellcheck": { "type": "shellcheck", "include": "(\\.sh$)", "exclude": [ "(^src/(secp256k1|univalue)/)" ] }, "lint-shell-locale": { "type": "lint-shell-locale", "include": "(\\.sh$)", "exclude": [ "(^src/(secp256k1|univalue)/)" ] }, "lint-cpp-void-parameters": { "type": "lint-cpp-void-parameters", "include": "(^src/.*\\.(h|cpp)$)", "exclude": [ "(^src/(crypto/ctaes|secp256k1|univalue|leveldb)/)", "(^src/compat/glibc_compat.cpp$)" ] }, "lint-logs": { "type": "lint-logs", "include": "(^src/.*\\.(h|cpp)$)" }, "lint-qt": { "type": "lint-qt", "include": "(^src/qt/.*\\.(h|cpp)$)", "exclude": [ "(^src/qt/(locale|forms|res)/)" ] } } } diff --git a/arcanist/linter/TestsLinter.php b/arcanist/linter/TestsLinter.php index 21ca11fc0a..4f0689891f 100644 --- a/arcanist/linter/TestsLinter.php +++ b/arcanist/linter/TestsLinter.php @@ -1,145 +1,145 @@ getProjectRoot()); } public function shouldUseInterpreter() { return true; } public function getDefaultInterpreter() { return "bash"; } public function getInstallInstructions() { return pht('The test/lint/lint-tests.sh script is part of the bitcoin-abc '. 'project'); } public function shouldExpectCommandErrors() { return false; } protected function getMandatoryFlags() { return array(); } protected function parseLinterOutput($path, $err, $stdout, $stderr) { /* * Stdout contains 2 sections: * 1/ Section with name mismatches, in the form: * :BOOST_FIXTURE_TEST_SUITE(, ... * 2/ Section with duplicated test names: * */ /* * Extract infos from the path * * Note: the files are already filtered by path thanks to the .arclint * configuration. If the file is not a test, the grep will find nothing and * there will be no error to parse. */ $pathinfo = pathinfo($path); $testName = $pathinfo['filename']; $fileName = $pathinfo['basename']; $messages = []; /* Search for mismatch, using the line pattern */ - $pattern = '/'.$fileName.':BOOST_FIXTURE_TEST_SUITE\(([\w]+)/'; + $pattern = '/'.$fileName.':BOOST_(?:AUTO|FIXTURE)_TEST_SUITE\(([\w]+)/'; $mismatch = preg_match($pattern, $stdout, $matches); if ($mismatch) { /* * Expect a single result as we are testing against a single file. * - $matches[0] contains the full mask * - $matches[1] contains the captured match */ if (count($matches) != 2) { throw new Exception( pht('Found multiple matches for a single file, lint-tests.sh output '. 'is not formatted as expected, aborting.')); } $mismatchName = $matches[1]; $messages[] = id(new ArcanistLintMessage()) ->setGranularity(ArcanistLinter::GRANULARITY_FILE) ->setCode('TESTS') ->setPath($path) ->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) ->setName('Name mismatch') ->setDescription( 'The Boost test suite name must match the file name (set to "'. $mismatchName.'", should be "'.$testName.'").'); } /* * Search for unicity, searching for test name alone on its line. * The test name can be whether the one extracted from the file name or the * one extracted from the BOOST_FIXTURE_TEST_SUITE content. */ if ($mismatch) { $pattern = '/^'.$testName.'|'.$mismatchName.'$/'; } else { $pattern = '/^'.$testName.'$/'; } $notUnique = preg_match($pattern, $stdout, $matches); /* * Do not check the number of matches here. * Because it is a test against unicity, there is a global search which can * possibly return an output matching our expected test name AND our actual * test name. This would be weird, but not impossible. * Just returning an error for the first one is enough, as the linter will * be rerun after the name is fix and the other match will then eventually * get catched. */ if ($notUnique) { $messages[] = id(new ArcanistLintMessage()) ->setGranularity(ArcanistLinter::GRANULARITY_FILE) ->setCode('TESTS') ->setPath($path) ->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) ->setName('Duplicated name') ->setDescription('The test name "'.$matches[0].'" already exists'); } return $messages; } } diff --git a/src/test/cuckoocache_tests.cpp b/src/test/cuckoocache_tests.cpp index be36d0c36b..e571a165bf 100644 --- a/src/test/cuckoocache_tests.cpp +++ b/src/test/cuckoocache_tests.cpp @@ -1,524 +1,524 @@ // Copyright (c) 2012-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include #include