diff --git a/.clang-tidy b/.clang-tidy index b4e660b85..31c6fedeb 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -88,7 +88,7 @@ Checks: '*,-abseil-*,-altera-*,-android-cloexec-*,-boost-use-ranges,-bugprone-ch # Readability is a matter of opinion here # #WarningsAsErrors: '*' -HeaderFilterRegex: '\/src\/' +HeaderFilterRegex: '\/(src|tests)\/' CheckOptions: - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor value: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a5fbadd5..b4039bcf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,6 +286,7 @@ if (CLANG_TIDY) add_custom_target(clang-tidy ${CLANG_TIDY} + --config-file ${CMAKE_SOURCE_DIR}/.clang-tidy -p ${CMAKE_BINARY_DIR} ${CT_CHECK_FILES} ) diff --git a/tests/common-cleanup.hpp b/tests/common-cleanup.hpp index 2fc870714..a480113d5 100644 --- a/tests/common-cleanup.hpp +++ b/tests/common-cleanup.hpp @@ -34,6 +34,12 @@ class file_t } } + file_t(file_t const &) = delete; + file_t &operator=(file_t const &) = delete; + + file_t(file_t &&) = delete; + file_t &operator=(file_t const &&) = delete; + ~file_t() noexcept { delete_file(true); } private: diff --git a/tests/common-pg.hpp b/tests/common-pg.hpp index 5189494e8..48a352483 100644 --- a/tests/common-pg.hpp +++ b/tests/common-pg.hpp @@ -132,6 +132,9 @@ class tempdb_t tempdb_t(tempdb_t &&) = delete; tempdb_t &operator=(tempdb_t const &&) = delete; + // We want to terminate the program if there is an exception thrown inside + // the destructor. + // NOLINTNEXTLINE(bugprone-exception-escape) ~tempdb_t() noexcept { if (m_db_name.empty()) {