Skip to content

Commit 2c48011

Browse files
Your Namehephaestus-omt
authored andcommitted
Execute the Provider ABI reference fixture
Run a compiled C probe through descriptor negotiation, owned-buffer release, and invalid-handle rejection so the Provider ABI v1 gate verifies behavior as well as symbols. Refs #1453
1 parent c2d6ce4 commit 2c48011

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

scripts/ci/check-provider-abi-v1.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ def compile_fixture(target):
109109
''')
110110
result = subprocess.run([cc, "-std=c11", "-Wall", "-Wextra", "-Werror", "-c", str(probe), "-o", str(directory / "provider-abi-probe.o")], capture_output=True, text=True)
111111
need(result.returncode == 0, f"C reference fixture ABI mismatch for {target}: {result.stderr}")
112+
runtime_probe = directory / "provider-abi-runtime-probe.c"
113+
runtime_probe.write_text(f'''#include "{C}"
114+
int main(void) {{
115+
axiom_provider_descriptor descriptor = {{0}};
116+
axiom_owned_bytes output = {{0}};
117+
axiom_borrowed_bytes input = {{NULL, 0}};
118+
if (axiom_provider_v1(&descriptor) != 0 || descriptor.major != 1 || descriptor.minor != 0 || descriptor.features != 0) return 1;
119+
if (axiom_provider_call(1, input, &output) != 0 || output.data != NULL || output.len != 0) return 2;
120+
axiom_provider_release_owned_buffer(output);
121+
if (axiom_provider_close_handle(1) != 0 || axiom_provider_close_handle(0) == 0) return 3;
122+
return 0;
123+
}}
124+
''')
125+
result = subprocess.run([cc, "-std=c11", "-Wall", "-Wextra", "-Werror", str(runtime_probe), "-o", str(directory / "provider-abi-runtime-probe")], capture_output=True, text=True)
126+
need(result.returncode == 0, f"C reference fixture runtime probe failed to compile for {target}: {result.stderr}")
127+
result = subprocess.run([str(directory / "provider-abi-runtime-probe")], capture_output=True, text=True)
128+
need(result.returncode == 0, f"C reference fixture runtime probe failed for {target}: {result.stderr}")
112129

113130
def main():
114131
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)