|
5 | 5 | 支持用例: |
6 | 6 | - 1294_1.tex: 无参自递归宏 (用例 249) |
7 | 7 | - 1294_2.tex: 带参自递归宏 (用例 289) |
| 8 | + - 1294_3.tex: 相互递归宏 (crash_pattern_c) |
8 | 9 |
|
9 | 10 | 启动命令: xmake r stem -d |
10 | 11 | 用法: |
11 | | - python3 1294.py # 默认依序测试 1294_1.tex 和 1294_2.tex |
| 12 | + python3 1294.py # 默认依序测试 1294_1.tex, 1294_2.tex, 1294_3.tex |
12 | 13 | python3 1294.py [path/to.tex] # 测试指定文件 |
13 | 14 | """ |
14 | 15 |
|
|
24 | 25 | from pynput.keyboard import Controller as Kbd, Key |
25 | 26 | from pynput.mouse import Controller as Mouse, Button |
26 | 27 |
|
27 | | -HERE = os.path.dirname(os.path.abspath(__file__)) |
| 28 | +# 定位工程根目录 |
| 29 | +_cur = os.path.dirname(os.path.abspath(__file__)) |
| 30 | +while _cur and _cur != "/" and not os.path.isdir(os.path.join(_cur, "TeXmacs")): |
| 31 | + _cur = os.path.dirname(_cur) |
| 32 | +ROOT_DIR = _cur if _cur else os.path.dirname(os.path.abspath(__file__)) |
| 33 | +HERE = ROOT_DIR |
28 | 34 |
|
29 | 35 | # 4K (3840x2312) 实测坐标 |
30 | 36 | POS_DOC = (960, 900) |
|
38 | 44 | ] |
39 | 45 |
|
40 | 46 | DEFAULT_CASES = [ |
41 | | - os.path.join(HERE, "TeXmacs", "tests", "tex", "1294_1.tex"), |
42 | | - os.path.join(HERE, "TeXmacs", "tests", "tex", "1294_2.tex"), |
| 47 | + os.path.join(ROOT_DIR, "TeXmacs", "tests", "tex", "1294_1.tex"), |
| 48 | + os.path.join(ROOT_DIR, "TeXmacs", "tests", "tex", "1294_2.tex"), |
| 49 | + os.path.join(ROOT_DIR, "TeXmacs", "tests", "tex", "1294_3.tex"), |
43 | 50 | ] |
44 | 51 |
|
45 | 52 |
|
|
0 commit comments