From c7db71d095e920578b51cd000f57d90ab1831207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 12 Nov 2024 09:48:09 +0100 Subject: [PATCH] test-spec: Add support for images in description --- test/spec/generate_spec.py | 51 +++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/test/spec/generate_spec.py b/test/spec/generate_spec.py index b1ed0173..10279a05 100755 --- a/test/spec/generate_spec.py +++ b/test/spec/generate_spec.py @@ -1,7 +1,6 @@ #!/bin/env python3 import os import ast -import graphviz import argparse import io import sys @@ -9,15 +8,47 @@ import re from pathlib import Path -# Define a custom NodeVisitor to extract the arguments +import graphviz + +def replace_image_tag(text, test_dir): + """ + Convert images added in the description and replace with the required ifdefs to work + generating the test specifcation as well. + """ + + pattern = r"image::(?P\S+)\[(?P