Some checks failed
CI / build-test-release (pull_request) Failing after 12m4s
One header per pass, asserting both directions — the objects that include it recompile, the ones that don't are untouched — then running the binary, since "was recompiled" only matters if the program agrees with itself. Covers the module interface (a macro in its global module fragment decides an exported class's layout), the implementation unit, a C source, an idle rebuild that must recompile nothing, and an object whose depfile is gone. The implementation unit's header has a space in its name so the depfile spells it escaped.
19 lines
745 B
C++
19 lines
745 B
C++
// SPDX-License-Identifier: LGPL-3.0-only
|
|
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
import std;
|
|
import Widget;
|
|
|
|
extern "C" long CounterLimitInLibrary();
|
|
|
|
// Prints "<sizeof here> <sizeof in library> <count> <limit>" and exits 1 when
|
|
// the two sizes disagree. The sizes are the mixed-layout check; the count and
|
|
// the limit report which build of the library's own objects got linked in, so a
|
|
// stale implementation object or C object shows up as an old value rather than
|
|
// as silence.
|
|
int main() {
|
|
std::size_t here = sizeof(Widget);
|
|
std::size_t inLibrary = WidgetSizeInLibrary();
|
|
std::print("{} {} {} {}", here, inLibrary, WidgetCountInLibrary(), CounterLimitInLibrary());
|
|
return here == inLibrary ? 0 : 1;
|
|
}
|