Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Checks: >
bugprone-*,
clang-diagnostic-*,
concurrency-*,
cppcoreguidelines-*,
llvm-include-order,
llvm-namespace-comment,
Expand Down
2 changes: 1 addition & 1 deletion modules/core/task/src/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
auto custom_terminate = []() {
std::cerr << "ORDER OF FUNCTIONS IS NOT RIGHT! \n"
"Expected - \"Validation\", \"PreProcessing\", \"Run\", \"PostProcessing\" \n";
std::exit(404);
std::abort();

Check warning on line 22 in modules/core/task/src/task.cpp

View check run for this annotation

Codecov / codecov/patch

modules/core/task/src/task.cpp#L22

Added line #L22 was not covered by tests
Comment thread
aobolensk marked this conversation as resolved.
Outdated
};
std::set_terminate(custom_terminate);
functions_order_.clear();
Expand Down
9 changes: 5 additions & 4 deletions modules/core/util/func_tests/util_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ TEST(util_tests, check_unset_env) {
#ifndef _WIN32
int save_var = ppc::util::GetPPCNumThreads();

unsetenv("OMP_NUM_THREADS"); // NOLINT(misc-include-cleaner)
unsetenv("OMP_NUM_THREADS"); // NOLINT(concurrency-mt-unsafe,misc-include-cleaner)

EXPECT_EQ(ppc::util::GetPPCNumThreads(), 1);

setenv("OMP_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(misc-include-cleaner)
setenv("OMP_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(concurrency-mt-unsafe,misc-include-cleaner)
#else
GTEST_SKIP();
#endif
Expand All @@ -25,11 +25,12 @@ TEST(util_tests, check_set_env) {
int save_var = ppc::util::GetPPCNumThreads();

const int num_threads = static_cast<int>(std::thread::hardware_concurrency());
setenv("OMP_NUM_THREADS", std::to_string(num_threads).c_str(), 1); // NOLINT(misc-include-cleaner)
// NOLINTNEXTLINE(concurrency-mt-unsafe,misc-include-cleaner)
setenv("OMP_NUM_THREADS", std::to_string(num_threads).c_str(), 1);

EXPECT_EQ(ppc::util::GetPPCNumThreads(), num_threads);

setenv("OMP_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(misc-include-cleaner)
setenv("OMP_NUM_THREADS", std::to_string(save_var).c_str(), 1); // NOLINT(concurrency-mt-unsafe,misc-include-cleaner)
#else
GTEST_SKIP();
#endif
Expand Down
2 changes: 1 addition & 1 deletion modules/core/util/src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int ppc::util::GetPPCNumThreads() {
}
int num_threads = std::atoi(omp_env);
#else
const char *omp_env = std::getenv("OMP_NUM_THREADS");
const char *omp_env = std::getenv("OMP_NUM_THREADS"); // NOLINT(concurrency-mt-unsafe)
int num_threads = (omp_env != nullptr) ? std::atoi(omp_env) : 1;
#endif
return num_threads;
Expand Down
2 changes: 1 addition & 1 deletion tasks/all/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class UnreadMessagesDetector : public ::testing::EmptyTestEventListener {
"[ PROCESS %d ] [ FAILED ] %s.%s: MPI message queue has an unread message from process %d with tag %d\n",
rank, "test_suite_name", "test_name", status.MPI_SOURCE, status.MPI_TAG);
MPI_Finalize();
exit(2);
std::abort();
}

MPI_Barrier(MPI_COMM_WORLD);
Expand Down
2 changes: 1 addition & 1 deletion tasks/mpi/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UnreadMessagesDetector : public ::testing::EmptyTestEventListener {
"[ PROCESS %d ] [ FAILED ] %s.%s: MPI message queue has an unread message from process %d with tag %d\n",
rank, "test_suite_name", "test_name", status.MPI_SOURCE, status.MPI_TAG);
MPI_Finalize();
exit(2);
std::abort();
}

MPI_Barrier(MPI_COMM_WORLD);
Expand Down
Loading