summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/selftest/oelib/elf.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-12-13 16:31:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-16 08:30:00 +0000
commit2001979ad41e6fdd5a37b0f90a96708f39c9df07 (patch)
tree62a425dfba8a12c5086d11622802aa72eeea421f /meta/lib/oeqa/selftest/oelib/elf.py
parenta8e7c5b415b99973c39a7ddd57cae45695fb0119 (diff)
downloadopenembedded-core-2001979ad41e6fdd5a37b0f90a96708f39c9df07.tar.gz
openembedded-core-2001979ad41e6fdd5a37b0f90a96708f39c9df07.tar.bz2
openembedded-core-2001979ad41e6fdd5a37b0f90a96708f39c9df07.zip
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 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/selftest/oelib/elf.py')
-rw-r--r--meta/lib/oeqa/selftest/oelib/elf.py21
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 @@
+import unittest
+import oe.qa
+
+class TestElf(unittest.TestCase):
+ def test_machine_name(self):
+ """
+ Test elf_machine_to_string()
+ """
+ self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
+ self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
+
+ self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
+ self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")
+ self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown ('foobar')")