From 100de9e5b9b321d2010e63668c26b91755fad057 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 18 Aug 2023 12:27:49 -0500 Subject: [PATCH] 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. --- tests/endorse.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tests/endorse.py diff --git a/tests/endorse.py b/tests/endorse.py new file mode 100755 index 0000000000..c87424329f --- /dev/null +++ b/tests/endorse.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import os +import sys +import pathlib + +for f in sys.argv[1:]: + if not f.endswith(".out"): + print(f"{f}:0: Not a .out file") + continue + p = pathlib.Path(f).stem + a, _, b = p.partition("_") + print(a, b) + p = pathlib.Path(a) / (b + ".exp") + print(f"{p}: Updating expected result from {f}") + os.rename(f, p)