Files
Viper_RegressionTesting/LogicFlowTest/App/main.vp
T
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

107 lines
4.1 KiB
Plaintext

import t, c
import config
import logic_test
import testcheck
def main() -> t.CInt:
testcheck.begin("LogicFlowTest: For/While/Match/控制流测试")
testcheck.section("For Range Basic Test (stop=5)")
logic_test.ForRangeBasicTest(5)
testcheck.ok("For Range Basic Test (5)")
testcheck.section("For Range With Start Stop Step (start=1, stop=10, step=2)")
logic_test.ForRangeWithStartStop(1, 10, 2)
testcheck.ok("For Range With Start Stop (1, 10, 2)")
testcheck.section("Nested For Range Test (rows=2, cols=3)")
logic_test.NestedForRangeTest(2, 3)
testcheck.ok("Nested For Range Test (2, 3)")
testcheck.section("For With If Break Test (size=8)")
logic_test.ForWithIfBreakTest(8)
testcheck.ok("For With If Break Test (8)")
testcheck.section("For With If Continue Test (n=10)")
logic_test.ForWithIfContinueTest(10)
testcheck.ok("For With If Continue Test (10)")
testcheck.section("For With Elif Branch Test (value=10)")
logic_test.ForWithElifBranchTest(10)
testcheck.ok("For With Elif Branch Test (10)")
testcheck.section("While With If Elif Else Test (iterations=7)")
logic_test.WhileWithIfElifElseTest(7)
testcheck.ok("While With If Elif Else Test (7)")
testcheck.section("While With Nested If Test (limit=4)")
logic_test.WhileWithNestedIfTest(4)
testcheck.ok("While With Nested If Test (4)")
testcheck.section("While With Match Case Test (value=2)")
logic_test.WhileWithMatchCaseTest(2)
testcheck.ok("While With Match Case Test (2)")
testcheck.section("While With Match Case Test (value=99)")
logic_test.WhileWithMatchCaseTest(99)
testcheck.ok("While With Match Case Test (99)")
testcheck.section("While With Match Case NoBreak Test (value=3)")
logic_test.WhileWithMatchCaseNoBreakTest(3)
testcheck.ok("While With Match Case NoBreak Test (3)")
testcheck.section("Complex For While Match Test (outer=3, inner=3)")
logic_test.ComplexForWhileMatchTest(3, 3)
testcheck.ok("Complex For While Match Test (3, 3)")
testcheck.section("For With Case And NoBreak Test (n=5)")
logic_test.ForWithCaseAndNoBreakTest(5)
testcheck.ok("For With Case And NoBreak Test (5)")
testcheck.section("While With Break Condition Test (limit=6)")
logic_test.WhileWithBreakConditionTest(6)
testcheck.ok("While With Break Condition Test (6)")
testcheck.section("Nested While With Multiple BreakPoints (depth=3, width=4)")
logic_test.NestedWhileWithMultipleBreakPoints(3, 4)
testcheck.ok("Nested While With Multiple BreakPoints (3, 4)")
testcheck.section("For With Match Case In Loop Test (iterations=9)")
logic_test.ForWithMatchCaseInLoopTest(9)
testcheck.ok("For With Match Case In Loop Test (9)")
testcheck.section("Complex Logic With Elif Chains (a=3, b=5, c=7)")
logic_test.ComplexLogicWithElifChains(3, 5, 7)
testcheck.ok("Complex Logic With Elif Chains (3, 5, 7)")
testcheck.section("For Range With Step And Condition (n=12, step=2)")
logic_test.ForRangeWithStepAndCondition(12, 2)
testcheck.ok("For Range With Step And Condition (12, 2)")
testcheck.section("Match Case With Guard Conditions (value=1)")
logic_test.MatchCaseWithGuardConditions(1)
testcheck.ok("Match Case With Guard Conditions (1)")
testcheck.section("While With Multiple Match Cases (iterations=12)")
logic_test.WhileWithMultipleMatchCases(12)
testcheck.ok("While With Multiple Match Cases (12)")
testcheck.section("For While Mix With Break And Continue (n=5)")
logic_test.ForWhileMixWithBreakAndContinue(5)
testcheck.ok("For While Mix With Break And Continue (5)")
testcheck.section("Complex Case Matching With Ranges (start=0, end=35)")
logic_test.ComplexCaseMatchingWithRanges(0, 35)
testcheck.ok("Complex Case Matching With Ranges (0, 35)")
testcheck.section("While With Elif In Elif Chain (limit=7)")
logic_test.WhileWithElifInElifChain(7)
testcheck.ok("While With Elif In Elif Chain (7)")
testcheck.section("For With Case NoBreak Nested (inner_limit=4)")
logic_test.ForWithCaseNoBreakNested(4)
testcheck.ok("For With Case NoBreak Nested (4)")
return testcheck.end()