Skip to content

Commit 100de9e

Browse files
committed
add a script to make it easy to endorse test output
Invoke it on the "out" file and it's moved to the correct "exp" file, ready to git add & git commit.
1 parent ca05761 commit 100de9e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/endorse.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python3
2+
import os
3+
import sys
4+
import pathlib
5+
6+
for f in sys.argv[1:]:
7+
if not f.endswith(".out"):
8+
print(f"{f}:0: Not a .out file")
9+
continue
10+
p = pathlib.Path(f).stem
11+
a, _, b = p.partition("_")
12+
print(a, b)
13+
p = pathlib.Path(a) / (b + ".exp")
14+
print(f"{p}: Updating expected result from {f}")
15+
os.rename(f, p)

0 commit comments

Comments
 (0)