Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The library uses a **specification-driven regex parsing** pattern with three lay

## Testing

- **Unit tests** in `tests/test_specs/` — test individual spec parsers against sample data in `tests/test_specs/data/`
- **Unit tests** in `tests/test_specs/` — cover only behaviour a regression fixture can't express: auto-detection, missing-flag hints (excluded from serialized output), derived-property logic (`function_name`/`error_location` precedence), and verdict combinations driven by synthetic specs. Anything that's "parse a real log with a registered backend and check the structured output" belongs in the regression suite, not here.
- **Regression tests** in `tests/regressions/` — data-driven: drop a `.log` and matching `.json` into `tests/regressions/samples/<spec>/` and the test auto-discovers them. The `.json` is the expected CLI JSON output minus the `output` field. Marked with `@pytest.mark.regression`, excluded from default pytest runs.

## Adding a New Verifier Backend
Expand Down
76 changes: 76 additions & 0 deletions tests/regressions/samples/pytest/multiple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"successful": false,
"issues": [
{
"error_type": "AssertionError",
"message": "assert 2048 == 208",
"stack_trace": [
{
"trace_index": 0,
"path": "tests/test_ai_models.py",
"name": null,
"line_idx": 26
}
],
"severity": "error",
"error_location": null
},
{
"error_type": "AssertionError",
"message": "assert 0 != 0",
"stack_trace": [
{
"trace_index": 0,
"path": "tests/test_esbmc.py",
"name": null,
"line_idx": 78
}
],
"severity": "error",
"error_location": null
},
{
"error_type": "AssertionError",
"message": "assert '[Counterexample]' not in 'esbmc --int...ound (k = 5)'",
"stack_trace": [
{
"trace_index": 0,
"path": "tests/test_esbmc.py",
"name": null,
"line_idx": 85
}
],
"severity": "error",
"error_location": null
},
{
"error_type": "AssertionError",
"message": "assert 'Compilation Error' != 'Compilation Error'",
"stack_trace": [
{
"trace_index": 0,
"path": "tests/test_esbmc.py",
"name": null,
"line_idx": 135
}
],
"severity": "error",
"error_location": null
},
{
"error_type": "AssertionError",
"message": "Different singleton classes should not share the same instance",
"stack_trace": [
{
"trace_index": 0,
"path": "tests/test_singleton.py",
"name": null,
"line_idx": 45
}
],
"severity": "error",
"error_location": null
}
],
"duration": 0.0
}
20 changes: 20 additions & 0 deletions tests/regressions/samples/pytest/multiple_collection_error.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"successful": false,
"issues": [
{
"error_type": "SyntaxError",
"message": "'(' was never closed",
"stack_trace": [
{
"trace_index": 0,
"path": "../../.local/share/hatch/env/virtual/esbmc-ai/9ZN5XdZG/hatch-test.py3.12/lib/python3.12/site-packages/_pytest/python.py",
"name": "importtestmodule",
"line_idx": 497
}
],
"severity": "error",
"error_location": null
}
],
"duration": 0.0
}
5 changes: 5 additions & 0 deletions tests/regressions/samples/pytest/successful.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"successful": true,
"issues": [],
"duration": 0.0
}
239 changes: 0 additions & 239 deletions tests/test_specs/test_pytest_spec.py

This file was deleted.

Loading