summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-10-04 14:08:11 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-10-07 13:37:39 +0200
commitf326c16bb288642246232ac173e2faa7cd4fad02 (patch)
treef2dcb94ce3abde1d452900af86710dc94b92d3ca /test
parent72fb5958427ef63181023e8fedce5c6ba642b01a (diff)
downloadjustbuild-f326c16bb288642246232ac173e2faa7cd4fad02.tar.gz
Enable clang-analyzer-cplusplus.StringChecker check.
Diffstat (limited to 'test')
-rw-r--r--test/utils/hermeticity/test_storage_config.hpp8
1 files changed, 6 insertions, 2 deletions
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) {