Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
test-data.hh
Go to the documentation of this file.
1#pragma once
3
4#include <filesystem>
6#include "nix/util/error.hh"
7
8namespace nix {
9
14static inline std::filesystem::path getUnitTestData()
15{
16 auto data = getEnv("_NIX_TEST_UNIT_DATA");
17 if (!data)
18 throw Error(
19 "_NIX_TEST_UNIT_DATA environment variable is not set. "
20 "Recommendation: use meson, example: 'meson test -C build --gdb'");
21 return std::filesystem::path(*data);
22}
23
24} // namespace nix
Definition error.hh:310
This file defines two main structs/classes used in nix error handling.