test(external): a sibling's pointers to its own Configuration hold

SiblingOwnPointers loads a fixture through LocalProject, on a fresh copy
outside the checkout: a library whose project file declares a test with
cfg.AddTest("OwnTest").Dependencies({ &cfg }). The one dependency of
that test has to be the Configuration LocalProject returns. The test
reads the dependency out of that Configuration and compares the two
addresses, without following the dependency.

Against the loader as it was before the fix the test fails: the
dependency is not that Configuration.
This commit is contained in:
Jorijn van der Graaf 2026-11-14 23:42:47 +01:00
commit 1440e20231
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
4 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,20 @@
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
import std;
import Crafter.Build;
using namespace Crafter;
// A library whose test depends on it: the test's dependency is a pointer to
// the Configuration this function returns. A library with no sources is
// enough, since the test that loads this file reads the pointer and builds
// nothing.
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>) {
Configuration cfg;
cfg.path = "./";
cfg.name = "own";
cfg.outputName = "own";
cfg.type = ConfigurationType::LibraryStatic;
cfg.AddTest("OwnTest").Dependencies({ &cfg });
return cfg;
}

View file

@ -0,0 +1,6 @@
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
int main() {
return 0;
}