Skip to content

Commit 75540ee

Browse files
Introduce test_driver.py
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
1 parent 9feeffe commit 75540ee

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""Library for building a TF-PSA-Crypto test driver from the built-in driver
2+
"""
3+
4+
# Copyright The Mbed TLS Contributors
5+
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
6+
#
7+
8+
import argparse
9+
10+
from pathlib import Path
11+
12+
def get_parsearg_base() -> argparse.ArgumentParser:
13+
""" Get base arguments for scripts building a TF-PSA-Crypto test driver """
14+
parser = argparse.ArgumentParser(description= \
15+
"Clone partially builtin tree, rewrite header inclusions and prefix"
16+
"exposed C identifiers.")
17+
18+
parser.add_argument("dst_dir", metavar="DST_DIR",
19+
help="Destination directory.\n"
20+
" - If absolute, used as-is.\n"
21+
" - If relative, interpreted relative to the repository root.\n")
22+
parser.add_argument("--driver", default="libtestdriver1", metavar="DRIVER",
23+
help="Test driver name (default: %(default)s).")
24+
return parser
25+
26+
class TestDriverGenerator:
27+
"""A TF-PSA-Crypto test driver generator"""
28+
def __init__(self, dst_dir: Path, driver: str):
29+
self.dst_dir = dst_dir
30+
self.driver = driver
31+
# Path of 'dst_dir'/include/'driver'
32+
self.test_driver_include_dir = None #type: Path | None

0 commit comments

Comments
 (0)