Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
libstore.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include <gtest/gtest.h>
5
#include <gmock/gmock.h>
6
7
#include "
nix/store/store-api.hh
"
8
#include "
nix/store/store-open.hh
"
9
#include "
nix/store/globals.hh
"
10
11
namespace
nix {
12
17
struct
EnableExperimentalFeature
18
{
19
std::set<ExperimentalFeature> previous;
20
21
explicit
EnableExperimentalFeature(std::string_view feature)
22
: previous(experimentalFeatureSettings.experimentalFeatures.get())
23
{
24
experimentalFeatureSettings.set(
"extra-experimental-features"
, std::string{feature});
25
}
26
27
~EnableExperimentalFeature()
28
{
29
experimentalFeatureSettings.experimentalFeatures.assign(previous);
30
}
31
32
EnableExperimentalFeature(
const
EnableExperimentalFeature &) =
delete
;
33
EnableExperimentalFeature & operator=(
const
EnableExperimentalFeature &) =
delete
;
34
};
35
36
class
LibStoreTest :
public
virtual
::testing::Test
37
{
38
public
:
39
static
void
SetUpTestSuite()
40
{
41
initLibStore(
false
);
42
}
43
44
protected
:
45
LibStoreTest(
ref<Store>
store)
46
: store(std::move(store))
47
{
48
}
49
50
LibStoreTest()
51
: LibStoreTest(
openStore
(
"dummy://"
))
52
{
53
}
54
55
ref<Store>
store;
56
};
57
58
}
/* namespace nix */
nix::ref
Definition
ref.hh:58
globals.hh
store-api.hh
store-open.hh
nix::openStore
ref< Store > openStore(StoreReference &&storeURI)
Definition
store-registration.cc:24
libstore-test-support
include
nix
store
tests
libstore.hh
Generated by
1.18.0