示例#1
0
def test_parse_gcc():
    memap = MemapParser()
    memap.parse(join(dirname(__file__), "gcc.map"), "GCC_ARM")

    parsed_data_os_agnostic = dict()
    for k in PARSED_GCC_DATA:
        parsed_data_os_agnostic[k.replace('/', sep)] = PARSED_GCC_DATA[k]

    assert memap.modules == parsed_data_os_agnostic
示例#2
0
文件: parse_test.py 项目: sg-/mbed-os
def test_parse_gcc():
    memap = MemapParser()
    memap.parse(join(dirname(__file__), "gcc.map"), "GCC_ARM")

    parsed_data_os_agnostic = dict()
    for k in PARSED_GCC_DATA:
        parsed_data_os_agnostic[k.replace('/', sep)] = PARSED_GCC_DATA[k]

    assert memap.modules == parsed_data_os_agnostic
示例#3
0
    def mem_stats(self, map):
        """! Creates parser object
        @param map Path to linker map file to parse and decode
        @return Memory summary structure with memory usage statistics
                None if map file can't be opened and processed
        """
        toolchain = self.__class__.__name__

        # Create memap object
        memap = MemapParser()

        # Parse and decode a map file
        if memap.parse(abspath(map), toolchain) is False:
            self.info("Unknown toolchain for memory statistics %s" % toolchain)
            return None

        # Write output to stdout in text (pretty table) format
        memap.generate_output('table')

        # Write output to file in JSON format
        map_out = splitext(map)[0] + "_map.json"
        memap.generate_output('json', map_out)

        # Write output to file in CSV format for the CI
        map_csv = splitext(map)[0] + "_map.csv"
        memap.generate_output('csv-ci', map_csv)

        # Here we return memory statistics structure (constructed after
        # call to generate_output) which contains raw data in bytes
        # about sections + summary
        return memap.mem_summary
示例#4
0
    def mem_stats(self, map):
        """! Creates parser object
        @param map Path to linker map file to parse and decode
        @return Memory summary structure with memory usage statistics
                None if map file can't be opened and processed
        """
        toolchain = self.__class__.__name__

        # Create memap object
        memap = MemapParser()

        # Parse and decode a map file
        if memap.parse(abspath(map), toolchain) is False:
            self.info("Unknown toolchain for memory statistics %s" % toolchain)
            return None

        # Write output to stdout in text (pretty table) format
        memap.generate_output('table')

        # Write output to file in JSON format
        map_out = splitext(map)[0] + "_map.json"
        memap.generate_output('json', map_out)

        # Write output to file in CSV format for the CI
        map_csv = splitext(map)[0] + "_map.csv"
        memap.generate_output('csv-ci', map_csv)

        # Here we return memory statistics structure (constructed after
        # call to generate_output) which contains raw data in bytes
        # about sections + summary
        return memap.mem_summary
示例#5
0
    def mem_stats(self, map):
        # Creates parser object
        toolchain = self.__class__.__name__

        # Create memap object
        memap = MemapParser()

        # Parse and decode a map file
        if memap.parse(abspath(map), toolchain) is False:
            self.info("Unknown toolchain for memory statistics %s" % toolchain)
            return

        # Write output to stdout in text (pretty table) format
        memap.generate_output("table")

        # Write output to file in JSON format
        map_out = splitext(map)[0] + "_map.json"
        memap.generate_output("json", map_out)

        # Write output to file in CSV format for the CI
        map_csv = splitext(map)[0] + "_map.csv"
        memap.generate_output("csv-ci", map_csv)
示例#6
0
    def mem_stats(self, map):
        # Creates parser object
        toolchain = self.__class__.__name__

        # Create memap object
        memap = MemapParser()

        # Parse and decode a map file
        if memap.parse(abspath(map), toolchain) is False:
            self.info("Unknown toolchain for memory statistics %s" % toolchain)
            return

        # Write output to stdout in text (pretty table) format
        memap.generate_output('table')

        # Write output to file in JSON format
        map_out = splitext(map)[0] + "_map.json"
        memap.generate_output('json', map_out)

        # Write output to file in CSV format for the CI
        map_csv = splitext(map)[0] + "_map.csv"
        memap.generate_output('csv-ci', map_csv)
示例#7
0
def test_parse_gcc():
    memap = MemapParser()
    memap.parse(join(dirname(__file__), "gcc.map"), "GCC_ARM")
    assert memap.modules == PARSED_GCC_DATA
    memap.parse(join(dirname(__file__), "gcc.map"), "GCC_CR")
    assert memap.modules == PARSED_GCC_DATA
示例#8
0
def test_parse_iar():
    memap = MemapParser()
    memap.parse(join(dirname(__file__), "iar.map"), "IAR")
    assert memap.modules == PARSED_IAR_DATA
示例#9
0
def test_parse_armcc():
    memap = MemapParser()
    memap.parse(join(dirname(__file__), "arm.map"), "ARM")
    assert memap.modules == PARSED_ARM_DATA
    memap.parse(join(dirname(__file__), "arm.map"), "UARM")
    assert memap.modules == PARSED_ARM_DATA