From 30b14bc47784cdcf1388a3c71928f40fe7babbb8 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Wed, 7 Oct 2026 19:02:52 +0800 Subject: [PATCH] =?UTF-8?q?chore(test):=20=E5=9B=9E=E5=BD=92=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=8E=BB=E9=99=A4=20*=5Fmlir=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=80=99=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 构建产物目录不再带 _mlir 后缀,两个回归脚本的目录探测候选同步收敛为 temp/output。 --- SequentialRegressionTest.py | 15 ++++----------- regression_test.py | 7 ++----- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/SequentialRegressionTest.py b/SequentialRegressionTest.py index 65a3ba8..c0fe7f8 100644 --- a/SequentialRegressionTest.py +++ b/SequentialRegressionTest.py @@ -105,31 +105,24 @@ def find_executables(output_dir): def find_output_dirs(proj_dir, proj_config): - """收集候选输出目录(兼容 TPC 与 TPV 布局) + """收集候选输出目录(TPC 与 TPV 布局一致:{build_dir}/output) - - {output_dir}(默认 output,TPC/旧布局) + - {output_dir}(默认 output) - {build_dir}/{output_dir}(build_dir 默认 .tpv_build) - - {build_dir}/output(TPV 布局:.tpv_build/output) - - 以上各项的 *_mlir 变体(单端 MLIR 布局:OutputDir = {BuildDir}/output_mlir, - 见 TransPyV/App/lib/Projectrans/Config.vp 的 mlir_dir_suffix()) + - {build_dir}/output 保序去重返回。 注意:ZlibDbg 等项目的 project.json 既无 output_dir 也无 build_dir, 此时必须仍把 .tpv_build/output 纳入候选,否则 TPV 编译成功的 exe 定位不到(报"无可执行二进制文件")。 - 单端 MLIR 后 exe 落在 {BuildDir}/output_mlir(非 output),且旧 LLVM 布局 - 的 output/ 可能残留同名旧 exe,故 *_mlir 变体**优先**探测。 """ od = proj_config.get('output_dir') or 'output' bd = proj_config.get('build_dir') or '.tpv_build' - # 单端 MLIR 目录后缀(与 Config.mlir_dir_suffix() 同口径,当前恒为 "_mlir") - mlir_suf = '_mlir' - base = [ + dirs = [ os.path.abspath(os.path.join(proj_dir, od)), os.path.abspath(os.path.join(proj_dir, bd, od)), os.path.abspath(os.path.join(proj_dir, bd, 'output')), ] - dirs = [d + mlir_suf for d in base] + base seen = set() uniq = [] for d in dirs: diff --git a/regression_test.py b/regression_test.py index 3d8496f..e7e27dc 100644 --- a/regression_test.py +++ b/regression_test.py @@ -230,9 +230,7 @@ def main(): proj_config = json.load(f) except Exception: continue - # 候选输出目录:兼容 TPC/旧 LLVM 布局(output)与单端 MLIR 布局 - # (OutputDir = {BuildDir}/output_mlir,见 Config.mlir_dir_suffix())。 - # 旧 output/ 可能残留同名旧 exe,故 *_mlir 变体优先探测。 + # 候选输出目录:TPC 与 TPV 布局一致(OutputDir = {BuildDir}/output) od = proj_config.get('output_dir') or 'output' bd = proj_config.get('build_dir') or '.tpv_build' base_dirs = [ @@ -241,8 +239,7 @@ def main(): os.path.join(proj_dir, bd, 'output'), ] exes = [] - for d in [os.path.abspath(x) + '_mlir' for x in base_dirs] \ - + [os.path.abspath(x) for x in base_dirs]: + for d in [os.path.abspath(x) for x in base_dirs]: exes = find_executables(d) if exes: break