mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-03 13:49:45 +00:00
Adds targeted test infrastructure and validation checks to protect table drawing hooks and drop-in framework contracts against unintended modifications. * CPTableViewDrawingTest: Verifies subclass invocation order for drawing steps and ensures application-specified background colors persist across theme-state changes. * DropInCompatibilityTest: Validates default theme names, window control configurations, pop-up button bezel styles, and table class defaults. * DropInSnapshot: Encapsulates theme attribute defaults, public API surface, default view construction, and window controls as structured data. * DropInBaselineGenerator: Provides tooling to capture current framework state as a baseline. * DropInBaselineTest: Compares framework artifacts against the established baseline, permitting additions while reporting modifications and removals. * DropInBaseline.json: Introduces the initial compatibility baseline artifact.
49 lines
1.7 KiB
Plaintext
49 lines
1.7 KiB
Plaintext
/*
|
|
* DropInBaselineGenerator.j
|
|
* AppKit
|
|
*
|
|
* Created by David Richardson on 31/10/2026.
|
|
* Copyright David Richardson 2026.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
@import "DropInSnapshot.j"
|
|
|
|
/*
|
|
Saves the drop-in baseline. Run this only against a build of main, and only
|
|
when a change to the drop-in contract is deliberate:
|
|
|
|
objj Tests/AppKit/DropInBaselineGenerator.j
|
|
*/
|
|
var fs = require("fs"),
|
|
path = require("path");
|
|
|
|
function main(args, namedArgs)
|
|
{
|
|
[[CPApplication alloc] init];
|
|
|
|
var snapshot = DropInCreateSnapshot(),
|
|
baselinePath = path.join(process.cwd(), "Tests", "AppKit", "Resources", "DropInBaseline.json");
|
|
|
|
fs.writeFileSync(baselinePath, JSON.stringify(snapshot, null, 1) + "\n");
|
|
|
|
print("Wrote " + baselinePath);
|
|
print(snapshot.publicClasses.length + " public classes, " +
|
|
Object.keys(snapshot.themeAttributes).length + " themed classes, " +
|
|
Object.keys(snapshot.construction).length + " constructed views, " +
|
|
Object.keys(snapshot.windows).length + " window styles");
|
|
}
|