mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 17:23:37 +08:00
refactor(test): centralize conformance fixture output paths (#16092)
* refactor(test): centralize conformance fixture output paths * refactor(test): keep compiler launch at its existing boundary
This commit is contained in:
@@ -51,16 +51,18 @@ process.stdout.write(
|
||||
`${JSON.stringify({ outputRoot, fixtureCount: fixtures.length, platform: hostPlatform, architecture })}\n`,
|
||||
);
|
||||
|
||||
function withOutput(name, args) {
|
||||
return [...args, "-o", join(outputRoot, name)];
|
||||
}
|
||||
|
||||
async function buildPortableFixtures() {
|
||||
await build({
|
||||
name: "c",
|
||||
sources: ["c/fixture.c"],
|
||||
arguments: [
|
||||
arguments: withOutput("c", [
|
||||
...toolchain.common,
|
||||
join(sourceRoot, "c/fixture.c"),
|
||||
"-o",
|
||||
join(outputRoot, "c"),
|
||||
],
|
||||
]),
|
||||
expectations: {
|
||||
symbols: ["rea_entry", "rea_branch", "rea_leaf", "rea_c_global"].map(
|
||||
(name) => `${symbolPrefix}${name}`,
|
||||
@@ -74,12 +76,10 @@ async function buildPortableFixtures() {
|
||||
await build({
|
||||
name: `version-${version}`,
|
||||
sources: [`versions/${version}.c`],
|
||||
arguments: [
|
||||
arguments: withOutput(`version-${version}`, [
|
||||
...toolchain.common,
|
||||
join(sourceRoot, `versions/${version}.c`),
|
||||
"-o",
|
||||
join(outputRoot, `version-${version}`),
|
||||
],
|
||||
]),
|
||||
expectations: {
|
||||
symbols: [
|
||||
`${symbolPrefix}rea_version_entry`,
|
||||
@@ -96,12 +96,7 @@ async function buildPortableFixtures() {
|
||||
await build({
|
||||
name: "large",
|
||||
sources: [{ path: "generated/large.c", content: largeSource }],
|
||||
arguments: [
|
||||
...toolchain.common,
|
||||
largePath,
|
||||
"-o",
|
||||
join(outputRoot, "large"),
|
||||
],
|
||||
arguments: withOutput("large", [...toolchain.common, largePath]),
|
||||
expectations: {
|
||||
symbolPrefix: `${symbolPrefix}rea_inventory_`,
|
||||
symbolCount: LARGE_FIXTURE_COUNT,
|
||||
@@ -117,15 +112,13 @@ async function buildDarwinFixtures() {
|
||||
await build({
|
||||
name: "objc",
|
||||
sources: ["objc/fixture.m"],
|
||||
arguments: [
|
||||
arguments: withOutput("objc", [
|
||||
...toolchain.common,
|
||||
"-fobjc-arc",
|
||||
join(sourceRoot, "objc/fixture.m"),
|
||||
"-framework",
|
||||
"Foundation",
|
||||
"-o",
|
||||
join(outputRoot, "objc"),
|
||||
],
|
||||
]),
|
||||
expectations: {
|
||||
symbols: ["_OBJC_CLASS_$_REAWidget"],
|
||||
stringFragments: [
|
||||
@@ -138,15 +131,13 @@ async function buildDarwinFixtures() {
|
||||
await build({
|
||||
name: "napi",
|
||||
sources: ["napi/fixture.c"],
|
||||
arguments: [
|
||||
arguments: withOutput("fixture.node", [
|
||||
...toolchain.common,
|
||||
"-bundle",
|
||||
"-undefined",
|
||||
"dynamic_lookup",
|
||||
join(sourceRoot, "napi/fixture.c"),
|
||||
"-o",
|
||||
join(outputRoot, "fixture.node"),
|
||||
],
|
||||
]),
|
||||
expectations: {
|
||||
symbols: ["_napi_register_module_v1"],
|
||||
stringMarkers: ["reaProbeOne", "reaProbeTwo", "reaProbeThree"],
|
||||
@@ -158,15 +149,13 @@ async function buildDarwinFixtures() {
|
||||
await build({
|
||||
name: "swift",
|
||||
sources: ["swift/fixture.swift"],
|
||||
arguments: [
|
||||
arguments: withOutput("swift", [
|
||||
"-sdk",
|
||||
sdkPath,
|
||||
"-Onone",
|
||||
"-g",
|
||||
join(sourceRoot, "swift/fixture.swift"),
|
||||
"-o",
|
||||
join(outputRoot, "swift"),
|
||||
],
|
||||
]),
|
||||
expectations: {
|
||||
stringMarkers: ["REA_SWIFT_EXECUTE"],
|
||||
stringFragments: ["REAService", "REARecord", "REAState", "REAProtocol"],
|
||||
|
||||
Reference in New Issue
Block a user