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:
parent
8baf14068e
commit
1440e20231
4 changed files with 77 additions and 0 deletions
20
tests/SiblingOwnPointers/fixture/project.cpp
Normal file
20
tests/SiblingOwnPointers/fixture/project.cpp
Normal 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;
|
||||
}
|
||||
6
tests/SiblingOwnPointers/fixture/tests/OwnTest/main.cpp
Normal file
6
tests/SiblingOwnPointers/fixture/tests/OwnTest/main.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in a new issue