Skip to content

Commit

Permalink
generate_*_tests.py: chdir to mbedtls root
Browse files Browse the repository at this point in the history
Do this in 2.28 just like it's done in the development branch, so that
code and command line usage that works on one branch doesn't surprisingly
fail on 2.28.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Oct 14, 2022
1 parent 4881540 commit f8d031f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/mbedtls_dev/test_data_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from abc import ABCMeta, abstractmethod
from typing import Callable, Dict, Iterable, Iterator, List, Type, TypeVar

from mbedtls_dev import build_tree
from mbedtls_dev import test_case

T = TypeVar('T') #pylint: disable=invalid-name
Expand Down Expand Up @@ -182,6 +183,12 @@ def main(args, description: str, generator_class: Type[TestGenerator] = TestGene
help='List available targets and exit')
parser.add_argument('targets', nargs='*', metavar='TARGET',
help='Target file to generate (default: all; "-": none)')

# Change to the mbedtls root, to keep things simple.
# Note that if any command line options refer to paths, they need to
# be adjusted first.
build_tree.chdir_to_root()

options = parser.parse_args(args)
generator = generator_class(options)
if options.list:
Expand Down

0 comments on commit f8d031f

Please sign in to comment.