Release SPHLite 0.8.2

This commit is contained in:
Codex
2026-07-05 17:00:13 +08:00
parent 0044ab67ad
commit 3934dc213b
73 changed files with 11818 additions and 259 deletions
+34 -3
View File
@@ -52,7 +52,7 @@ def main() -> int:
version = run_command([exe, "--version"])
require_field(version.stdout, "version")
if "0.8.1" not in version.stdout:
if "0.8.2" not in version.stdout:
raise AssertionError("CLI version mismatch")
inspect = run_command([exe, model])
@@ -127,7 +127,7 @@ def main() -> int:
):
require_field(inspect.stdout, field)
inspect_fields = read_fields(inspect.stdout)
if inspect_fields["version"] != "0.8.1":
if inspect_fields["version"] != "0.8.2":
raise AssertionError("inspect version field mismatch")
if Path(inspect_fields["input"]) != Path(model):
raise AssertionError("inspect input field mismatch")
@@ -211,8 +211,22 @@ def main() -> int:
output_step = int(run_fields["step"])
output_file = Path(output_dir) / f"sphlite_{output_step:08d}.csv"
summary_file = Path(output_dir) / f"sphlite_{output_step:08d}_summary.csv"
if not output_file.exists() or not summary_file.exists():
vtu_file = Path(output_dir) / f"sphlite_{output_step:08d}.vtu"
pvd_file = Path(output_dir) / "sphlite.pvd"
if (
not output_file.exists()
or not summary_file.exists()
or not vtu_file.exists()
or not pvd_file.exists()
):
raise AssertionError("CLI output files were not written")
if "<VTKFile type=\"UnstructuredGrid\"" not in vtu_file.read_text(encoding="utf-8"):
raise AssertionError("CLI VTU file is not a VTK XML unstructured grid")
pvd_text = pvd_file.read_text(encoding="utf-8")
if "<VTKFile type=\"Collection\"" not in pvd_text:
raise AssertionError("CLI PVD file is not a VTK XML collection")
if vtu_file.name not in pvd_text:
raise AssertionError("CLI PVD file does not reference the final VTU file")
summary = read_summary(summary_file)
if int(summary["step"]) != output_step:
raise AssertionError("CLI summary step does not match actual step")
@@ -225,6 +239,23 @@ def main() -> int:
missing_arg = run_command([exe], expect_ok=False)
if "usage:" not in missing_arg.stdout:
raise AssertionError("missing input did not print usage")
worker_missing_case = run_command(
[exe, "--cclite-worker", "--ipc-name", "mock-ipc"],
expect_ok=False,
)
if "worker --case is required" not in (
worker_missing_case.stdout + worker_missing_case.stderr
):
raise AssertionError("worker missing case error mismatch")
worker_unsupported = run_command(
[exe, "--cclite-worker", "--case", model, "--ipc-name", "mock-ipc"],
expect_ok=False,
)
if (
"worker_state: ERROR" not in worker_unsupported.stdout
or "error_code: 3" not in worker_unsupported.stdout
):
raise AssertionError("worker unsupported state was not reported")
missing_file = run_command([exe, str(Path(output_dir) / "missing.inp")], expect_ok=False)
require_field(missing_file.stderr, "error_code")
conflict = run_command([exe, model, "--run", "--check"], expect_ok=False)