Fix setting for default test suite directory
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
parent
52ae326ebb
commit
07c830c164
1 changed files with 7 additions and 1 deletions
|
@ -138,7 +138,8 @@ class BaseTarget(metaclass=ABCMeta):
|
||||||
class TestGenerator:
|
class TestGenerator:
|
||||||
"""Generate test cases and write to data files."""
|
"""Generate test cases and write to data files."""
|
||||||
def __init__(self, options) -> None:
|
def __init__(self, options) -> None:
|
||||||
self.test_suite_directory = getattr(options, 'directory', 'tests/suites')
|
self.test_suite_directory = self.get_option(options, 'directory',
|
||||||
|
'tests/suites')
|
||||||
# Update `targets` with an entry for each child class of BaseTarget.
|
# Update `targets` with an entry for each child class of BaseTarget.
|
||||||
# Each entry represents a file generated by the BaseTarget framework,
|
# Each entry represents a file generated by the BaseTarget framework,
|
||||||
# and enables generating the .data files using the CLI.
|
# and enables generating the .data files using the CLI.
|
||||||
|
@ -147,6 +148,11 @@ class TestGenerator:
|
||||||
for subclass in BaseTarget.__subclasses__()
|
for subclass in BaseTarget.__subclasses__()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_option(options, name: str, default: T) -> T:
|
||||||
|
value = getattr(options, name, None)
|
||||||
|
return default if value is None else value
|
||||||
|
|
||||||
def filename_for(self, basename: str) -> str:
|
def filename_for(self, basename: str) -> str:
|
||||||
"""The location of the data file with the specified base name."""
|
"""The location of the data file with the specified base name."""
|
||||||
return posixpath.join(self.test_suite_directory, basename + '.data')
|
return posixpath.join(self.test_suite_directory, basename + '.data')
|
||||||
|
|
Loading…
Reference in a new issue