feat: config-driven multi-scenario + gcda accumulation fix + gcov merge fix
Config-driven architecture: - coverage_dates: YAML-driven date replacement for LEAVE_RECORDS - row_overrides: per-scenario field overrides (e.g. STATUS='9') - delete_all_rows: per-scenario table emptying for empty-cursor tests gcda accumulation fix (V3 bug #7): - Delete .gcda before each scenario run to prevent GnuCOBOL accumulation - Force-copy scenario gcda (skip mtime check) - Copy scenario DB to CWD data/kin.db for CONNECT TO path resolution Multi-run gcov merge fix: - Always merge multi-run gcov data regardless of generate_coverage flag - Fix v3_root UnboundLocalError in cleanup path Other fixes: - _make_key_unique: skip WHERE-constrained columns to avoid PK conflict - incremental_supplement: support fields_dict for base record generation - check_coverage: use structure coverage data if available - orchestrator.py: filter _-prefixed fields in TestCase; merge Agent2Data cases
This commit is contained in:
@@ -28,7 +28,7 @@ from .core import build_branch_tree, classify_field_roles, _init_child_names, sq
|
||||
from .cond import parse_single_condition, is_field, collect_leaves
|
||||
from .pipeline_bridge import build_branch_tree_fallback
|
||||
from .design_mcdc import enum_paths as mcdc_enum_paths, _filter_stop
|
||||
from .design import enum_paths, generate_records, get_term_type, extend_abend_programs
|
||||
from .design import enum_paths, generate_records, get_term_type, extend_abend_programs, make_base_record
|
||||
from .output import output_json, output_input_files
|
||||
from .coverage import run_coverage, generate_coverage_index, collect_decision_points, mark_coverage
|
||||
from japanese_data import generate_fullwidth_text, generate_halfwidth_katakana, generate_wareki_date
|
||||
@@ -1195,6 +1195,7 @@ def extract_structure(cobol_source: str, copybook_dirs: list = None) -> dict:
|
||||
"if_types": if_types,
|
||||
"variable_patterns": variable_patterns,
|
||||
"open_pattern": open_pattern,
|
||||
"data_fields": fields_dict,
|
||||
}
|
||||
|
||||
|
||||
@@ -1353,12 +1354,13 @@ def generate_data(cobol_source: str, structure: dict = None,
|
||||
return records
|
||||
|
||||
|
||||
def incremental_supplement(branch_tree, decision_gaps: list[int]) -> list[dict]:
|
||||
def incremental_supplement(branch_tree, decision_gaps: list[int], fields_dict: list = None) -> list[dict]:
|
||||
"""针对未覆盖的决策点,增量生成补充测试数据。
|
||||
|
||||
Args:
|
||||
branch_tree: extract_structure() 返回的 branch_tree 字段
|
||||
decision_gaps: 未覆盖的决策点 ID 列表,如 [1, 3, 5]
|
||||
fields_dict: 字段定义列表(DATA DIVISION 展开后),提供后生成含字段值的记录
|
||||
|
||||
Returns:
|
||||
list[dict]: 增量测试数据,格式与 generate_data() 兼容
|
||||
@@ -1390,10 +1392,12 @@ def incremental_supplement(branch_tree, decision_gaps: list[int]) -> list[dict]:
|
||||
|
||||
supplements = []
|
||||
for i, (kind, label) in enumerate(found):
|
||||
supplements.append({
|
||||
"_dec_id": f"incr_{i}",
|
||||
"_kind": kind,
|
||||
"_label": str(label)[:60],
|
||||
})
|
||||
rec = {}
|
||||
if fields_dict:
|
||||
rec = make_base_record(i + 1, fields_dict)
|
||||
rec["_dec_id"] = f"incr_{i}"
|
||||
rec["_kind"] = kind
|
||||
rec["_label"] = str(label)[:60]
|
||||
supplements.append(rec)
|
||||
|
||||
return supplements
|
||||
|
||||
Reference in New Issue
Block a user