Use the base name of the generating script, not the full path
Otherwise the generation is sensitive to trivial differences such as
running `tests/scripts/generate_psa_tests.py` vs
`./tests/scripts/generate_psa_tests.py` vs an absolute path.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/scripts/mbedtls_dev/test_case.py b/scripts/mbedtls_dev/test_case.py
index a6ed8fc..c476d1e 100644
--- a/scripts/mbedtls_dev/test_case.py
+++ b/scripts/mbedtls_dev/test_case.py
@@ -17,6 +17,7 @@
# limitations under the License.
import binascii
+import os
import sys
from typing import Any, Iterable, List, Optional
import typing_extensions #pylint: disable=import-error
@@ -98,7 +99,7 @@
If the file already exists, it is overwritten.
"""
if caller is None:
- caller = sys.argv[0]
+ caller = os.path.basename(sys.argv[0])
with open(filename, 'w') as out:
out.write('# Automatically generated by {}. Do not edit!\n'
.format(caller))