Debian Codegraph @

rpython/translator/platform/arch/test/test_s390x.py

raw symbols SCIP
1 import py
2 import platform
3 from rpython.translator.platform.arch.s390x import (s390x_cpu_revision,
4 extract_s390x_cpu_ids)
5
6 if platform.machine() != 's390x':
7 py.test.skip("s390x tests only")
8
9 def test_cpuid_s390x():
10 revision = s390x_cpu_revision()
11 assert revision != 'unknown', 'the model you are running on might be too old'
12
13 def test_read_processor_info():
14 ids = extract_s390x_cpu_ids("""
15 processor 0: machine = 12345
16 processor 1: version = FF, identification = AF
17 """.splitlines())
18 assert ids == [(0, None, None, 0x12345),
19 (1, 'FF', 'AF', 0),
20 ]
21
22