mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(ldgen): correct formatting issues reported by ruff
Resolve ruff's UP031 errors related to the use of percent formatting for strings and lines longer than 120 characters. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import collections
|
||||
@@ -12,19 +12,27 @@ import unittest
|
||||
from io import StringIO
|
||||
|
||||
try:
|
||||
from ldgen.entity import Entity, EntityDB
|
||||
from ldgen.entity import Entity
|
||||
from ldgen.entity import EntityDB
|
||||
from ldgen.fragments import parse_fragment_file
|
||||
from ldgen.generation import Generation, GenerationException
|
||||
from ldgen.generation import Generation
|
||||
from ldgen.generation import GenerationException
|
||||
from ldgen.linker_script import LinkerScript
|
||||
from ldgen.output_commands import AlignAtAddress, InputSectionDesc, SymbolAtAddress
|
||||
from ldgen.output_commands import AlignAtAddress
|
||||
from ldgen.output_commands import InputSectionDesc
|
||||
from ldgen.output_commands import SymbolAtAddress
|
||||
from ldgen.sdkconfig import SDKConfig
|
||||
except ImportError:
|
||||
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
||||
from ldgen.entity import Entity, EntityDB
|
||||
from ldgen.entity import Entity
|
||||
from ldgen.entity import EntityDB
|
||||
from ldgen.fragments import parse_fragment_file
|
||||
from ldgen.generation import Generation, GenerationException
|
||||
from ldgen.generation import Generation
|
||||
from ldgen.generation import GenerationException
|
||||
from ldgen.linker_script import LinkerScript
|
||||
from ldgen.output_commands import AlignAtAddress, InputSectionDesc, SymbolAtAddress
|
||||
from ldgen.output_commands import AlignAtAddress
|
||||
from ldgen.output_commands import InputSectionDesc
|
||||
from ldgen.output_commands import SymbolAtAddress
|
||||
from ldgen.sdkconfig import SDKConfig
|
||||
|
||||
ROOT = Entity('*')
|
||||
@@ -39,7 +47,6 @@ FREERTOS2 = Entity('libfreertos2.a')
|
||||
|
||||
|
||||
class GenerationTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.generation = Generation()
|
||||
self.entities = None
|
||||
@@ -125,7 +132,6 @@ class GenerationTest(unittest.TestCase):
|
||||
|
||||
|
||||
class DefaultMappingTest(GenerationTest):
|
||||
|
||||
def test_rule_generation_default(self):
|
||||
# Checks that default rules are generated from
|
||||
# the default scheme properly and even if no mappings
|
||||
@@ -138,7 +144,7 @@ class DefaultMappingTest(GenerationTest):
|
||||
def test_default_mapping_lib(self):
|
||||
# Mapping a library with default mapping. This should not emit additional rules,
|
||||
# other than the default ones.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -150,7 +156,7 @@ entries:
|
||||
def test_default_mapping_obj(self):
|
||||
# Mapping an object with default mapping. This should not emit additional rules,
|
||||
# other than the default ones.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -162,7 +168,7 @@ entries:
|
||||
def test_default_mapping_symbol(self):
|
||||
# Mapping a symbol with default mapping. This should not emit additional rules,
|
||||
# other than the default ones.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -174,7 +180,7 @@ entries:
|
||||
def test_default_mapping_all(self):
|
||||
# Mapping a library, object, and symbol with default mapping. This should not emit additional rules,
|
||||
# other than the default ones.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -191,7 +197,7 @@ entries:
|
||||
#
|
||||
# This is a check needed to make sure generation does not generate
|
||||
# intermediate commands due to presence of symbol mapping.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -207,7 +213,7 @@ entries:
|
||||
#
|
||||
# This is a check needed to make sure generation does not generate
|
||||
# intermediate commands due to presence of symbol mapping.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -234,7 +240,7 @@ class BasicTest(GenerationTest):
|
||||
# iram0_text
|
||||
# *(.iram ...)
|
||||
# *libfreertos.a(.literal ...) B
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -264,14 +270,14 @@ entries:
|
||||
# There should be exclusions in the default commands for flash_text and flash_rodata:
|
||||
#
|
||||
# flash_text
|
||||
# *((EXCLUDE_FILE(libfreertos.a:croutine)) .literal ...) A
|
||||
# *((EXCLUDE_FILE(libfreertos.a:croutine)) .literal ...) A
|
||||
#
|
||||
# Commands placing the entire library in iram, dram should be generated:
|
||||
#
|
||||
# iram0_text
|
||||
# *(.iram ...)
|
||||
# *libfreertos.a:croutine(.literal ...) B
|
||||
mapping = u"""
|
||||
# *libfreertos.a:croutine(.literal ...) B
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -299,19 +305,20 @@ entries:
|
||||
|
||||
def test_nondefault_mapping_symbol(self):
|
||||
# Test mapping entry different from default for symbol.
|
||||
# There should be exclusions in the default commands for flash_text, as well as the implicit intermediate object command
|
||||
# There should be exclusions in the default commands for flash_text, as
|
||||
# well as the implicit intermediate object command
|
||||
# with an exclusion from default:
|
||||
#
|
||||
# flash_text
|
||||
# *((EXCLUDE_FILE(libfreertos.a:croutine)) .literal ...) A
|
||||
# *libfreertos.a:croutine(.literal .literal.prvCheckDelayedList ...) B
|
||||
# *((EXCLUDE_FILE(libfreertos.a:croutine)) .literal ...) A
|
||||
# *libfreertos.a:croutine(.literal .literal.prvCheckDelayedList ...) B
|
||||
#
|
||||
# Commands placing the entire library in iram should be generated:
|
||||
#
|
||||
# iram0_text
|
||||
# *(.iram ...)
|
||||
# *libfreertos.a:croutine(.text.prvCheckPendingReadyList .literal.prvCheckPendingReadyList) C
|
||||
mapping = u"""
|
||||
# *libfreertos.a:croutine(.text.prvCheckPendingReadyList .literal.prvCheckPendingReadyList) C
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -340,7 +347,9 @@ entries:
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Input section commands in iram_text for #1 C
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -422,14 +431,14 @@ entries:
|
||||
# object file, including .debug, .comment and other input section.
|
||||
#
|
||||
# flash.rodata
|
||||
# *((EXCLUDE_FILE(*libsoc.a:temperature_sensor_periph.*)) .rodata.* ...) A
|
||||
# # *libsoc.a:temperature_sensor_periph.* X
|
||||
# *((EXCLUDE_FILE(*libsoc.a:temperature_sensor_periph.*)) .rodata.* ...) A
|
||||
# # *libsoc.a:temperature_sensor_periph.* X
|
||||
#
|
||||
# Commands placing the entire library in iram should be generated:
|
||||
#
|
||||
# dram0_data
|
||||
# *libsoc.a:temperature_sensor_periph.*(.rodata.temperature_sensor_attribute) B
|
||||
mapping = u"""
|
||||
# *libsoc.a:temperature_sensor_periph.*(.rodata.temperature_sensor_attribute) B
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libsoc.a
|
||||
entries:
|
||||
@@ -447,14 +456,15 @@ entries:
|
||||
flash_rodata[0].exclusions.add(TEMPERATURE_SENSOR_PERIPH)
|
||||
|
||||
# Input section commands in dram0_data for #1 B
|
||||
dram0_data.append(InputSectionDesc(TEMPERATURE_SENSOR_PERIPH,
|
||||
set(['.rodata.temperature_sensor_attributes']),
|
||||
[]))
|
||||
dram0_data.append(
|
||||
InputSectionDesc(TEMPERATURE_SENSOR_PERIPH, set(['.rodata.temperature_sensor_attributes']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
def test_default_symbol_nondefault_lib(self):
|
||||
# Test default symbol mapping with different lib mapping. This should create an implicit intermediate object command.
|
||||
# Test default symbol mapping with different lib mapping. This should
|
||||
# create an implicit intermediate object command.
|
||||
# The significant targets are flash_text, flash_rodata, iram0_text, dram0_data.
|
||||
#
|
||||
# flash_text
|
||||
@@ -474,7 +484,7 @@ entries:
|
||||
# libfreertos.a ( .rodata ...) C.2
|
||||
#
|
||||
# Only default commands are in the other targets.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -511,7 +521,9 @@ entries:
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Command for #2 B
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
flash_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -536,7 +548,7 @@ entries:
|
||||
# *libfreertos.a:croutine(.rodata ....) C.2
|
||||
#
|
||||
# Only default commands are in the other targets
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -570,7 +582,9 @@ entries:
|
||||
dram0_data.append(InputSectionDesc(CROUTINE, flash_rodata[0].sections, []))
|
||||
|
||||
# Command for #2 B
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
flash_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -603,7 +617,7 @@ entries:
|
||||
# libfreertos.a (EXCLUDE_FILE(libfreertos:croutine) .rodata ...) C
|
||||
#
|
||||
# For the other targets only the default commands should be present.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -646,14 +660,16 @@ entries:
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Command for #3 D
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
def test_nondefault_but_same_lib_and_obj(self):
|
||||
# Extension of DefaultMappingTest. Commands should not be generated for #2, since it does similar mapping
|
||||
# to #1. Output is similar to test_different_mapping_lib.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -665,7 +681,7 @@ entries:
|
||||
def test_nondefault_but_same_lib_and_sym(self):
|
||||
# Extension of DefaultMappingTest. Commands should not be generated for #2, since it does similar mapping
|
||||
# to #1. Output is similar to test_different_mapping_lib.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -677,7 +693,7 @@ entries:
|
||||
def test_nondefault_but_same_obj_and_sym(self):
|
||||
# Commands should not be generated for #2, since it does similar mapping
|
||||
# to #1. Output is similar to test_different_mapping_obj.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -698,7 +714,7 @@ entries:
|
||||
# iram0_text
|
||||
#
|
||||
#
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -730,8 +746,12 @@ entries:
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Commands for #1 & 2
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckDelayedList', '.literal.prvCheckDelayedList']), []))
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckDelayedList', '.literal.prvCheckDelayedList']), [])
|
||||
)
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -742,7 +762,7 @@ entries:
|
||||
# iram0_text
|
||||
# * (.custom_section) A
|
||||
# * (.iram .iram.*)
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[sections:custom_section]
|
||||
entries:
|
||||
.custom_section
|
||||
@@ -771,7 +791,6 @@ entries:
|
||||
|
||||
|
||||
class AdvancedTest(GenerationTest):
|
||||
|
||||
# Test valid but quirky cases, corner cases, failure cases, and
|
||||
# cases involving interaction between schemes, other mapping
|
||||
# fragments.
|
||||
@@ -798,7 +817,7 @@ class AdvancedTest(GenerationTest):
|
||||
# *(.data ..)
|
||||
# *(.dram ...)
|
||||
# *libfreertos.a:croutine(.rodata .rodata.*) D
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -852,7 +871,7 @@ entries:
|
||||
# *(.data ..)
|
||||
# *(.dram ...)
|
||||
# *libfreertos.a:croutine(.rodata .rodata.*) D
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -889,7 +908,7 @@ entries:
|
||||
# noflash = text -> iram0_text, rodata -> dram0_data
|
||||
#
|
||||
# This operation should fail.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -908,7 +927,7 @@ entries:
|
||||
# noflash = .text -> iram0_text, .rodata -> dram0_data
|
||||
#
|
||||
# This operation should fail.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[sections:custom_text]
|
||||
entries:
|
||||
.text+
|
||||
@@ -932,42 +951,42 @@ entries:
|
||||
# using another. Another object and symbol is mapped the other way around.
|
||||
#
|
||||
# flash_text
|
||||
# *(EXCLUDE_FILE(libfreertos.a:croutine libfreertos.a:timers) .text ...) A, B
|
||||
# *(EXCLUDE_FILE(libfreertos.a:croutine libfreertos.a:timers) .text ...) A, B
|
||||
#
|
||||
# flash_rodata
|
||||
# *(EXCLUDE_FILE(libfreertos.a:croutine libfreertos.a:timers) .rodata ...) A, B
|
||||
# *(EXCLUDE_FILE(libfreertos.a:croutine libfreertos.a:timers) .rodata ...) A, B
|
||||
#
|
||||
# dram0_data
|
||||
# *(EXCLUDE_FILES(libfreertos.a:timers) .data ..) B
|
||||
# *(EXCLUDE_FILES(libfreertos.a:timers) .data ..) B
|
||||
# *(.dram ...)
|
||||
# *libfreertos.a:croutine(.rodata .rodata.*) C
|
||||
# *libfreertos.a:timers(.rodata.prvProcessReceivedCommands ...) E
|
||||
# *libfreertos.a:croutine(.rodata .rodata.*) C
|
||||
# *libfreertos.a:timers(.rodata.prvProcessReceivedCommands ...) E
|
||||
#
|
||||
# dram0_bss
|
||||
# *(EXCLUDE_FILE(libfreertos.a:timers) .bss .bss.* ...) B
|
||||
# *(EXCLUDE_FILE(libfreertos.a:timers) COMMON) B
|
||||
# *(EXCLUDE_FILE(libfreertos.a:timers) .bss .bss.* ...) B
|
||||
# *(EXCLUDE_FILE(libfreertos.a:timers) COMMON) B
|
||||
#
|
||||
# iram0_text
|
||||
# *(.iram ...)
|
||||
# *libfreertos.a:croutine(.literal .literal.prvCheckDelayedList ...) C
|
||||
# *libfreertos.a:timers(.literal .literal.prvProcessReceivedCommands ...) E
|
||||
# *libfreertos.a:croutine(.literal .literal.prvCheckDelayedList ...) C
|
||||
# *libfreertos.a:timers(.literal .literal.prvProcessReceivedCommands ...) E
|
||||
#
|
||||
# rtc_text
|
||||
# *(rtc.text .rtc.literal)
|
||||
# libfreertos.a:croutine (.text.prvCheckPendingReadyList .literal.prvCheckPendingReadyList) F
|
||||
# libfreertos.a:timers (.text .text.prvCheckForValidListAndQueue ...) D.2
|
||||
# libfreertos.a:croutine (.text.prvCheckPendingReadyList .literal.prvCheckPendingReadyList) F
|
||||
# libfreertos.a:timers (.text .text.prvCheckForValidListAndQueue ...) D.2
|
||||
#
|
||||
# rtc_data
|
||||
# *(rtc.data)
|
||||
# *(rtc.rodata)
|
||||
# libfreertos.a:timers (.data .data.*) D
|
||||
# libfreertos.a:timers (.rodata ...) D.2
|
||||
# libfreertos.a:timers (.data .data.*) D
|
||||
# libfreertos.a:timers (.rodata ...) D.2
|
||||
#
|
||||
# rtc_bss
|
||||
# *(rtc.bss .rtc.bss)
|
||||
# libfreertos.a:timers (.bss .bss.*) D
|
||||
# libfreertos.a:timers (COMMON) D
|
||||
mapping = u"""
|
||||
# libfreertos.a:timers (.bss .bss.*) D
|
||||
# libfreertos.a:timers (COMMON) D
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1015,7 +1034,9 @@ entries:
|
||||
|
||||
# Commands for #4 F
|
||||
# Processed first due to alphabetical ordering
|
||||
rtc_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
rtc_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
# Commands for #2 D
|
||||
# List all relevant sections excluding #3 for text -> rtc_text and D.2
|
||||
@@ -1037,7 +1058,11 @@ entries:
|
||||
rtc_bss.append(InputSectionDesc(TIMERS, dram0_bss[1].sections, []))
|
||||
|
||||
# Commands for #3 E
|
||||
iram0_text.append(InputSectionDesc(TIMERS, set(['.text.prvProcessReceivedCommands', '.literal.prvProcessReceivedCommands']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(
|
||||
TIMERS, set(['.text.prvProcessReceivedCommands', '.literal.prvProcessReceivedCommands']), []
|
||||
)
|
||||
)
|
||||
dram0_data.append(InputSectionDesc(TIMERS, set(['.rodata.prvProcessReceivedCommands']), []))
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
@@ -1054,7 +1079,7 @@ entries:
|
||||
# * (EXCLUDE_FILE(libfreertos.a libfreertos.a:croutine) .text ...)
|
||||
#
|
||||
# iram0_text
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test_1]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1099,7 +1124,7 @@ entries:
|
||||
#
|
||||
# Uses the same entries as C_05 but spreads them across
|
||||
# two fragments. The output should still be the same.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test_1]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1117,7 +1142,7 @@ entries:
|
||||
def test_mapping_same_lib_in_multiple_fragments_conflict(self):
|
||||
# Test mapping fragments operating on the same archive
|
||||
# with conflicting mappings.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test_1]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1149,7 +1174,7 @@ entries:
|
||||
# libfreertos:croutine(.text.prvCheckPendingReadyList .literal.prvCheckPendingReadyList) G
|
||||
# libfreertos2:croutine(.text .literal ...) D
|
||||
# libfreertos2:croutine2(.text .literal ...) E
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:freertos2]
|
||||
archive: libfreertos2.a
|
||||
entries:
|
||||
@@ -1187,8 +1212,12 @@ entries:
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Command for
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckDelayedList', '.literal.prvCheckDelayedList']), []))
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckDelayedList', '.literal.prvCheckDelayedList']), [])
|
||||
)
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
iram0_text.append(InputSectionDesc(Entity(FREERTOS2.archive, 'croutine'), flash_text[0].sections, []))
|
||||
iram0_text.append(InputSectionDesc(Entity(FREERTOS2.archive, 'croutine2'), flash_text[0].sections, []))
|
||||
@@ -1197,7 +1226,7 @@ entries:
|
||||
|
||||
def test_ambigious_obj(self):
|
||||
# Command generation for ambiguous entry should fail.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1214,7 +1243,7 @@ entries:
|
||||
#
|
||||
# 'custom_scheme' entries conflict the 'default' scheme
|
||||
# entries.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[scheme:custom_scheme]
|
||||
entries:
|
||||
flash_text -> iram0_text
|
||||
@@ -1234,7 +1263,7 @@ entries:
|
||||
#
|
||||
# custom_scheme has the 'iram -> iram0_text' in common with
|
||||
# default scheme
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[sections:custom_section]
|
||||
entries:
|
||||
.custom_section
|
||||
@@ -1269,7 +1298,7 @@ class ConfigTest(GenerationTest):
|
||||
def _test_conditional_on_scheme(self, perf, alt=None):
|
||||
# Test that proper commands are generated if using
|
||||
# schemes with conditional entries.
|
||||
scheme = u"""
|
||||
scheme = """
|
||||
[sections:cond_text_data]
|
||||
entries:
|
||||
if PERFORMANCE_LEVEL >= 1:
|
||||
@@ -1286,7 +1315,7 @@ entries:
|
||||
cond_text_data -> dram0_data
|
||||
"""
|
||||
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: lib.a
|
||||
entries:
|
||||
@@ -1321,7 +1350,7 @@ entries:
|
||||
def test_conditional_mapping(self, alt=None):
|
||||
# Test that proper commands are generated
|
||||
# in conditional mapping entries.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default]
|
||||
archive: *
|
||||
entries:
|
||||
@@ -1370,7 +1399,7 @@ entries:
|
||||
def test_multiple_fragment_same_lib_conditional(self):
|
||||
# Test conditional entries on new mapping fragment grammar.
|
||||
# across multiple fragments.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default]
|
||||
archive: *
|
||||
entries:
|
||||
@@ -1402,7 +1431,6 @@ entries:
|
||||
|
||||
|
||||
class FlagTest(GenerationTest):
|
||||
|
||||
# Test correct generation of mapping fragment entries
|
||||
# with flags.
|
||||
|
||||
@@ -1433,7 +1461,7 @@ class FlagTest(GenerationTest):
|
||||
# libfreertos.a:croutine(.text .literal ...) I
|
||||
# . = ALIGN(4) G.2
|
||||
# _sym1_end H.2
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1493,7 +1521,7 @@ entries:
|
||||
# iram0_text
|
||||
# *(.iram .iram.*)
|
||||
# libfreertos.a:croutine(.text.prvCheckPendingReadyList ...) D
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default]
|
||||
archive: *
|
||||
entries:
|
||||
@@ -1537,7 +1565,9 @@ entries:
|
||||
flash_text.append(SymbolAtAddress('_sym1_end'))
|
||||
|
||||
# Command for #3 D
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -1555,7 +1585,7 @@ entries:
|
||||
# iram0_text
|
||||
# *(.iram .iram.*)
|
||||
# libfreertos.a:croutine(.text.prvCheckPendingReadyList ...) D
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1594,7 +1624,9 @@ entries:
|
||||
flash_text.append(SymbolAtAddress('_sym1_end'))
|
||||
|
||||
# Command for #3 C
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -1611,7 +1643,7 @@ entries:
|
||||
# iram0_text
|
||||
# *(.iram .iram.*)
|
||||
# libfreertos.a:croutine(.text.prvCheckPendingReadyList ...) C
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1646,7 +1678,9 @@ entries:
|
||||
flash_text.append(SymbolAtAddress('_sym1_end'))
|
||||
|
||||
# Command for #3 C
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -1662,7 +1696,7 @@ entries:
|
||||
# iram0_text
|
||||
# *(.iram .iram.*)
|
||||
# libfreertos.a:croutine(.text.prvCheckPendingReadyList ...) D
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default]
|
||||
archive: *
|
||||
entries:
|
||||
@@ -1707,7 +1741,9 @@ entries:
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Command for #4 D
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
@@ -1724,7 +1760,7 @@ entries:
|
||||
# iram0_text
|
||||
# *(.iram .iram.*)
|
||||
# libfreertos.a:croutine(.text.prvCheckPendingReadyList ...) D
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:test]
|
||||
archive: libfreertos.a
|
||||
entries:
|
||||
@@ -1764,14 +1800,16 @@ entries:
|
||||
flash_text.append(InputSectionDesc(CROUTINE, set(filtered_sections), []))
|
||||
|
||||
# Command for #3 C
|
||||
iram0_text.append(InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), []))
|
||||
iram0_text.append(
|
||||
InputSectionDesc(CROUTINE, set(['.text.prvCheckPendingReadyList', '.literal.prvCheckPendingReadyList']), [])
|
||||
)
|
||||
|
||||
self.compare_rules(expected, actual)
|
||||
|
||||
def test_flag_additions(self):
|
||||
# Test ability to add flags as long as no other mapping fragments
|
||||
# does the same thing.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default_add_flag]
|
||||
archive: *
|
||||
entries:
|
||||
@@ -1792,7 +1830,7 @@ entries:
|
||||
def test_flags_flag_additions_duplicate(self):
|
||||
# Test same flags added to same entity - these
|
||||
# are ignored.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default_add_flag_1]
|
||||
archive: *
|
||||
entries:
|
||||
@@ -1819,7 +1857,7 @@ entries:
|
||||
def test_flags_flag_additions_conflict(self):
|
||||
# Test condition where multiple fragments specifies flags
|
||||
# to same entity - should generate exception.
|
||||
mapping = u"""
|
||||
mapping = """
|
||||
[mapping:default_add_flag_1]
|
||||
archive: *
|
||||
entries:
|
||||
|
||||
Reference in New Issue
Block a user