feat: move pretty_output to Python

* Remove pretty_output_line from Bash
* Remove pretty_output_line from click CLI

Co-Authored-By: Anja Rabich <a.rabich@uni-luebeck.de>
This commit is contained in:
Benjamin Lipp
2025-06-10 17:13:42 +02:00
parent 2628adbac8
commit 2e27753f4a
3 changed files with 7 additions and 13 deletions

View File

@@ -15,9 +15,9 @@
* `pretty_output` Bash function * `pretty_output` Bash function
* ~~pretty_output_line~~ * ~~pretty_output_line~~
* ~~click function intervention weirdness~~
* ~~why is everything red in the pretty output? (see line 96 in __init__.py)~~
* awk RESULT flush in marzipan() * awk RESULT flush in marzipan()
* click function intervention weirdness
* why is everything red in the pretty output? (see line 96 in __init__.py)
* move the whole metaverif function to Python * move the whole metaverif function to Python
* move the whole analyze function to Python * move the whole analyze function to Python
* find the files * find the files

View File

@@ -53,11 +53,6 @@ def awk_prep(cpp_prep, awk_prep):
file.write("\nprocess main") file.write("\nprocess main")
#@click.command()
#@click.argument("prefix", required=True)
#@click.argument("mark", required=True)
#@click.argument("color", required=True)
#@click.argument("text", default='')
def pretty_output_line(prefix, mark, color, text): def pretty_output_line(prefix, mark, color, text):
prefix = f"[grey42]{prefix}[/grey42]" prefix = f"[grey42]{prefix}[/grey42]"
content = f"[{color}]{mark} {text}[/{color}]" content = f"[{color}]{mark} {text}[/{color}]"
@@ -93,7 +88,11 @@ def pretty_output(file_path):
for outp in pkgs.sys.stdin: for outp in pkgs.sys.stdin:
tz = pkgs.time.time() tz = pkgs.time.time()
if outp == expected[ctr]:
# Output from ProVerif contains a trailing newline, which we do not have in the expected output. Remove it for meaningful matching.
outp_clean = outp.rstrip()
if outp_clean == expected[ctr]:
pretty_output_line(f"{int(tz - ta)}s ", "", "green", descs[ctr]) pretty_output_line(f"{int(tz - ta)}s ", "", "green", descs[ctr])
else: else:
res = 1 res = 1
@@ -154,6 +153,5 @@ main.add_command(clean)
main.add_command(run_proverif) main.add_command(run_proverif)
main.add_command(cpp) main.add_command(cpp)
main.add_command(awk_prep) main.add_command(awk_prep)
#main.add_command(pretty_output_line)
main.add_command(pretty_output) main.add_command(pretty_output)
main.add_command(clean_warnings) main.add_command(clean_warnings)

4
marzipan/src/analyze.sh Executable file → Normal file
View File

@@ -24,10 +24,6 @@ color_clear=''
checkmark="✔" checkmark="✔"
cross="❌" cross="❌"
pretty_output_line() {
exc rosenpass-marzipan pretty-output-line "${@}"
}
pretty_output() { pretty_output() {
exc rosenpass-marzipan pretty-output "${@}" exc rosenpass-marzipan pretty-output "${@}"
} }