diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-04 14:08:11 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-10-07 13:37:39 +0200 |
commit | f326c16bb288642246232ac173e2faa7cd4fad02 (patch) | |
tree | f2dcb94ce3abde1d452900af86710dc94b92d3ca /test | |
parent | 72fb5958427ef63181023e8fedce5c6ba642b01a (diff) | |
download | justbuild-f326c16bb288642246232ac173e2faa7cd4fad02.tar.gz |
Enable clang-analyzer-cplusplus.StringChecker check.
Diffstat (limited to 'test')
-rw-r--r-- | test/utils/hermeticity/test_storage_config.hpp | 8 |
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) { |