Test that secure/non-secure memories are passed

To managed bootloader mode
pull/10113/head
Jimmy Brisson 2019-03-14 14:23:36 -05:00
parent a666e976a2
commit 10c6a277d3
2 changed files with 19 additions and 7 deletions

View File

@ -604,8 +604,8 @@ class Config(object):
# name, exit with error # name, exit with error
if cfg["name"] in self.lib_config_data: if cfg["name"] in self.lib_config_data:
raise ConfigException( raise ConfigException(
"Library name '%s' is not unique " "Library name '{}' is not unique "
"(defined in '%s' and '%s')".format( "(defined in '{}' and '{}')".format(
cfg["name"], cfg["name"],
full_path, full_path,
self.lib_config_data[cfg["name"]]["__config_path"] self.lib_config_data[cfg["name"]]["__config_path"]

View File

@ -16,16 +16,15 @@ limitations under the License.
""" """
import os import os
import sys
import json import json
import pytest import pytest
from mock import patch from mock import patch
from hypothesis import given
from hypothesis.strategies import sampled_from
from os.path import join, isfile, dirname, abspath from os.path import join, isfile, dirname, abspath
from tools.build_api import get_config from tools.build_api import get_config
from tools.targets import set_targets_json_location, Target, TARGET_NAMES from tools.targets import set_targets_json_location
from tools.config import ConfigException, Config, ConfigParameter, ConfigMacro from tools.config import (
ConfigException, Config, ConfigParameter, ConfigMacro, ROM_ALL_MEMORIES
)
from tools.resources import Resources from tools.resources import Resources
NOT_CONFIG = [ NOT_CONFIG = [
@ -250,3 +249,16 @@ def test_parameters_and_config_macros_to_macros():
macro_list = Config._parameters_and_config_macros_to_macros(params, macros) macro_list = Config._parameters_and_config_macros_to_macros(params, macros)
assert macro_list == ["CUSTOM_MACRO_NAME=1"] assert macro_list == ["CUSTOM_MACRO_NAME=1"]
@pytest.mark.parametrize("target_start_size", [
("FUTURE_SEQUANA_PSA", 0x10080000, 0x78000),
("FUTURE_SEQUANA_M0_PSA", 0x10000000, 0x80000)
])
def test_PSA_overrides(target_start_size):
target, start, size = target_start_size
set_targets_json_location()
config = Config(target)
roms = config.get_all_active_memories(ROM_ALL_MEMORIES)
assert("ROM" in roms)
assert(roms["ROM"] == [start, size])