summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy2
-rw-r--r--test/utils/hermeticity/test_storage_config.hpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 3034f0e1..acd90baa 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -3,7 +3,7 @@ Checks: >-
*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-darwin-*,-fuchsia-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-zircon-*
WarningsAsErrors: >-
bugprone-*,-bugprone-easily-swappable-parameters,-bugprone-unchecked-optional-access,
- clang-analyzer-*,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-cplusplus.StringChecker,
+ clang-analyzer-*,-clang-analyzer-cplusplus.NewDeleteLeaks,
clang-diagnostic-*,-clang-diagnostic-unused-command-line-argument,
hicpp-*,
performance-*,-performance-avoid-endl,
diff --git a/test/utils/hermeticity/test_storage_config.hpp b/test/utils/hermeticity/test_storage_config.hpp
index 5f5ecab4..4335592c 100644
--- a/test/utils/hermeticity/test_storage_config.hpp
+++ b/test/utils/hermeticity/test_storage_config.hpp
@@ -41,9 +41,13 @@ class TestStorageConfig final {
* there. Hence we set the storage root to a fixed location under
* TEST_TMPDIR which is set by the test launcher.
*/
+ char const* const env_tmpdir = std::getenv("TEST_TMPDIR");
+ if (env_tmpdir == nullptr) {
+ Logger::Log(LogLevel::Debug, "missing TEST_TMPDIR env variable");
+ std::exit(EXIT_FAILURE);
+ }
auto const test_tempdir =
- std::filesystem::path{std::string{std::getenv("TEST_TMPDIR")}} /
- ".test_build_root";
+ std::filesystem::path{std::string{env_tmpdir}} / ".test_build_root";
auto temp_dir = TmpDir::Create(test_tempdir);
if (temp_dir == nullptr) {