diff options
author | Ross Burton <ross.burton@intel.com> | 2016-12-13 16:31:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-16 10:23:22 +0000 |
commit | d535aba974d47802c80ea1f9c678c0e8351523bb (patch) | |
tree | 962fc0721d8d9495e0450dceca26318ba3567190 /meta/lib/oeqa/selftest/oelib/elf.py | |
parent | 94c29c100873fd8606ad60f194c9b9e7c7a71e85 (diff) | |
download | poky-d535aba974d47802c80ea1f9c678c0e8351523bb.tar.gz |
oeqa: move lib/oe tests to oe-selftest
These tests don't get ran often (as demonstrated by the fact that some were not
ported to Python 3), so move them to oeqa/selftest so they get executed
frequently and can be extended easily.
[ YOCTO #7376 ]
(From OE-Core rev: 2001979ad41e6fdd5a37b0f90a96708f39c9df07)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/oelib/elf.py')
-rw-r--r-- | meta/lib/oeqa/selftest/oelib/elf.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/oelib/elf.py b/meta/lib/oeqa/selftest/oelib/elf.py new file mode 100644 index 0000000000..1f59037ed9 --- /dev/null +++ b/meta/lib/oeqa/selftest/oelib/elf.py | |||
@@ -0,0 +1,21 @@ | |||
1 | import unittest | ||
2 | import oe.qa | ||
3 | |||
4 | class TestElf(unittest.TestCase): | ||
5 | def test_machine_name(self): | ||
6 | """ | ||
7 | Test elf_machine_to_string() | ||
8 | """ | ||
9 | self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC") | ||
10 | self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86") | ||
11 | self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS") | ||
12 | self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC") | ||
13 | self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM") | ||
14 | self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH") | ||
15 | self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64") | ||
16 | self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64") | ||
17 | self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64") | ||
18 | |||
19 | self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)") | ||
20 | self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)") | ||
21 | self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown ('foobar')") | ||