Files
css/tests/css_conformance_host.cpp
T
waozi 240cf61ab6 Test the CSS subset on every backend
Behavior tests for the parser, sheets, formatter, migrator and DOM
export; a conformance digest that C, C++, Go, ZX, Android and the
browser export must agree on; and a sanitized fuzzer. The export keeps
Kryon's rule ranking, HSL rounds as browsers round it, and the
migrator refuses output that would not parse.
2026-11-07 13:53:00 -03:00

23 lines
731 B
C++

// A C++ host linking the style code as a C library, as C++ apps do.
// Prints the digests in the C program's format.
#include <cstdint>
#include <cstdio>
extern "C" {
uint32_t CssConformanceDigest(int32_t pack, int32_t theme);
int32_t CssConformanceAll(void);
}
int main() {
const char *packs[] = {"classic", "material", "lightfield"};
const char *themes[] = {"light", "dark"};
for (int32_t pack = 0; pack < 3; ++pack) {
for (int32_t theme = 0; theme < 2; ++theme) {
std::printf("%s %s %u\n", packs[pack], themes[theme],
static_cast<unsigned>(CssConformanceDigest(pack, theme)));
}
}
std::printf("all %d\n", static_cast<int>(CssConformanceAll()));
return 0;
}