File: test_asm.py

package info (click to toggle)
m1n1 1.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,468 kB
  • sloc: python: 42,002; ansic: 33,376; asm: 1,101; makefile: 271; xml: 177; sh: 116
file content (21 lines) | stat: -rw-r--r-- 708 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# SPDX-License-Identifier: MIT
"""Tests for proxyclient/m1n1/asm.py"""

import re

class TestArmAsm:
    """proxyclient.m1n1.ARMAsm tests"""

    def test_compile(self, fx_asm_object, fx_asm_object_start):
        """Test basic compilation"""
        assert fx_asm_object.start == fx_asm_object_start

    def test_objdump(self, capfd, fx_asm_object, fx_asm_object_disasm):
        """Test object dump"""
        fx_asm_object.objdump()
        out, _ = capfd.readouterr()
        out = re.sub(r"/.*/b.elf:", "/tmp/b.elf:", out, count=1)
        if fx_asm_object.toolchain.use_clang:
            assert out == fx_asm_object_disasm["clang"]
        else:
            assert out == fx_asm_object_disasm["gcc"]