Commit Graph
8 Commits
Author SHA1 Message Date
TermiNexus 7451adf523 test(lifetime): 新增 NewLifetimeTest/NewLifetimeFreeTest 与 IR 断言,escape 跑法纳入新项目
- NewLifetimeTest(正向,9 用例自检 + 退出码判定):出口释放 / 循环内覆盖释放 / 别名只释放一次 / 嵌套函数登记区间隔离 / early return / void 裸 return / 仅分支里 new 时 free(NULL) / stack slife 不释放。

- NewLifetimeFreeTest(负向):对 slife 对象手动 stdlib.free → LifetimeError。

- SequentialRegressionTest 增 IR_EXPECT:编译成功后断言生成的 IR 出现 llvm.call @free(漏释放=纯泄漏,退出码看不出来);--escape/--only 纳入两个新项目,run_lifetime_negative_tests.py 同步。
2026-10-08 20:04:12 +08:00
TermiNexus 12c96d3039 fix(test): --exe 绝对化并校验存在性,修 Test/NewTest 报 cannot find the path specified
编译以 cwd=项目目录 执行,--exe 若是相对路径会按各项目层级解析:根级 escape 项目只深一层能命中,Test/NewTest 深两层就启动失败(耗时 0.0s 且无任何产物)。

SequentialRegressionTest.build_compile_cmd 与 run_lifetime_negative_tests.py 都改为 os.path.abspath(--exe),并在文件不存在时立即报错退出(避免静默跑到最后一个项目才暴露)。
2026-10-08 18:03:12 +08:00
TermiNexus 73846979f1 test(lifetime): SequentialRegressionTest 支持负向项目(反向判定)
NEGATIVE_PROJECTS: EscapeTest/EscapeMethodTest/EscapeXmodTest 期望编译失败且输出含 LifetimeError;命中即通过并跳过运行阶段,编译成功=漏检直接终止,报错方向不符亦终止。

regression_test.py 的 --escape 剔除负向项目(该脚本要求编译成功+能跑,纳入会误报),并提示改用 SequentialRegressionTest 或 run_lifetime_negative_tests.py。README 同步。
2026-10-08 17:56:58 +08:00
TermiNexus 42ca901b28 test(new): 新增 NewTest 工程;两个回归脚本支持 --escape/--only 单独跑
NewTest:M2.4 new 描述符冒烟(stack→alloca、heap→malloc;memgr 段待确认管理器 API,非法组合以注释列出)。

regression_test.py / SequentialRegressionTest.py 新增 --escape(只跑生命期/逃逸 + new 相关项目)与 --only(逗号分隔指定项目);两者都会在 Test/<名> 与仓库根 <名> 查找 project.json / project.vpj,故根级 Escape* 项目也能直接跑;--escape 忽略 README 难度顺序。

README.md:新增「一·附 生命期/逃逸相关测试」一节,列出 5 个项目的期望结果与单独运行命令。
2026-10-08 17:47:24 +08:00
TermiNexus 30b14bc477 chore(test): 回归脚本去除 *_mlir 目录候选
构建产物目录不再带 _mlir 后缀,两个回归脚本的目录探测候选同步收敛为 temp/output。
2026-10-07 19:02:52 +08:00
TermiNexus fb8b56f2f1 fix(test): 回归脚本输出目录候选补 *_mlir 变体,修单端 MLIR 下 exe 定位失败
单端 MLIR 后 OutputDir = {BuildDir}/output_mlir(Config.mlir_dir_suffix()),
但 SequentialRegressionTest.find_output_dirs 与 regression_test 只探
output/ 与 .tpv_build/output,导致编译成功却报"未找到可执行文件"
(MLIRLiteTest 实测)。两处补 *_mlir 变体并优先探测(旧 output/ 可能
残留同名旧 exe)。
2026-10-04 20:54:56 +08:00
TermiNexus 9fef174f3e fix(sequential-regression): 产物定位兜底 TPV 默认 .tpv_build/output 2026-10-03 12:30:06 +08:00
TermiNexus 3c6fb1d246 chore(test): 初始化回归测试仓(新增 .gitignore,TestsOverview.md 改为 README.md)
把 Test/ 纳入 https://git.gvsds.com/GVSDS/Viper_RegressionTesting 。

1) 新增 .gitignore —— 只保留测试源码,剔除全部构建产物:
   目录   **/output*/(output / output_opt / output_orig / output_verify / output_dbg)、
          **/temp*/(temp / temp_opt)、**/.tpv_build/
   二进制 *.exe *.obj *.o *.out *.a *.lib *.dll
   中间物 *.ll *.vpi *.pyi *.deps.txt *.deps.json *.doc.json *_sha1_map.txt
          _pyi_cache_v1.pkl _pyi_cache_v1.sig.json _shared_sym.json _phase1_manifest.json
   其它   build_all.txt(构建日志)、*.log、__pycache__/、*.bak、IDE 目录
   保留   App/*.vp、project.json / project_opt.json / project.vpj、README.md、两个 .py
   实测 `git add -A --dry-run`:196 个文件,无任何构建产物混入。

2) TestsOverview.md → README.md(作为仓库首页文档)。

3) SequentialRegressionTest.py:7 处 TestsOverview.md 引用同步改为 README.md
   (文档串、OVERVIEW 路径、read_test_order 文档与报错文案、argparse description、
   启动横幅);同时修正入口路径 PROJECTRANS —— 旧值 <root>/Projectrans.py 已不存在,
   改为 <root>/TransPyC/Projectrans.py(与 regression_test.py:45-48 记录一致),
   否则本脚本会以 "can't open file" 全量失败。
   regression_test.py 无需改动:它按目录扫描 project.json 找项目,不引用该文档。
2026-09-29 15:14:59 +08:00