1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-15 05:21:03 +01:00

Merge remote-tracking branch 'origin/2.29-maintenance' into detsys-main

This commit is contained in:
Eelco Dolstra 2025-05-16 12:48:44 +02:00
commit c20642ac7b
354 changed files with 6768 additions and 3808 deletions

View file

@ -5,6 +5,7 @@
#include <gmock/gmock.h>
#include "nix/store/store-api.hh"
#include "nix/store/store-open.hh"
namespace nix {

View file

@ -11,8 +11,6 @@
#include <filesystem>
#include <gtest/gtest.h>
namespace fs { using namespace std::filesystem; }
namespace nixC {
class nix_api_store_test : public nix_api_util_context
{
@ -27,10 +25,10 @@ public:
{
nix_store_free(store);
for (auto & path : fs::recursive_directory_iterator(nixDir)) {
fs::permissions(path, fs::perms::owner_all);
for (auto & path : std::filesystem::recursive_directory_iterator(nixDir)) {
std::filesystem::permissions(path, std::filesystem::perms::owner_all);
}
fs::remove_all(nixDir);
std::filesystem::remove_all(nixDir);
}
Store * store;
@ -45,7 +43,7 @@ protected:
auto tmpl = nix::defaultTempDir() + "/tests_nix-store.";
for (size_t i = 0; true; ++i) {
nixDir = tmpl + std::string { i };
if (fs::create_directory(nixDir)) break;
if (std::filesystem::create_directory(nixDir)) break;
}
#else
// resolve any symlinks in i.e. on macOS /tmp -> /private/tmp

View file

@ -14,8 +14,9 @@ Gen<OutputsSpec> Arbitrary<OutputsSpec>::arbitrary()
return gen::just((OutputsSpec) OutputsSpec::All{});
case 1:
return gen::map(
gen::nonEmpty(gen::container<StringSet>(
gen::map(gen::arbitrary<StorePathName>(), [](StorePathName n) { return n.name; }))),
gen::nonEmpty(
gen::container<StringSet>(
gen::map(gen::arbitrary<StorePathName>(), [](StorePathName n) { return n.name; }))),
[](StringSet names) { return (OutputsSpec) OutputsSpec::Names{names}; });
default:
assert(false);