Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
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
10
11namespace nix {
12
17struct 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
36class LibStoreTest : public virtual ::testing::Test
37{
38public:
39 static void SetUpTestSuite()
40 {
41 initLibStore(false);
42 }
43
44protected:
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 */
Definition ref.hh:58
ref< Store > openStore(StoreReference &&storeURI)
Definition store-registration.cc:24