Explicitly split test files for readelf and test files for unittests.
authorEli Bendersky <eliben@gmail.com>
Sat, 25 May 2013 12:56:37 +0000 (05:56 -0700)
committerEli Bendersky <eliben@gmail.com>
Sat, 25 May 2013 12:56:37 +0000 (05:56 -0700)
This is so the readelf tests auto-discovery doens't accidentally find
tests it's not supposed to.

Also fixed some Python 3 compatibility issues in test_solaris_support

31 files changed:
test/run_readelf_tests.py
test/test_arm_support.py
test/test_solaris_support.py
test/testfiles/exe_simple32.elf [deleted file]
test/testfiles/exe_simple64.elf [deleted file]
test/testfiles/exe_solaris32_cc.elf [deleted file]
test/testfiles/exe_solaris32_cc.elf.sparc [deleted file]
test/testfiles/exe_solaris64_cc.elf [deleted file]
test/testfiles/exe_solaris64_cc.elf.sparc [deleted file]
test/testfiles/exe_stripped64.elf [deleted file]
test/testfiles/libelf0_8_13_32bit.so.elf [deleted file]
test/testfiles/obj_simple32.o.elf [deleted file]
test/testfiles/penalty_32_gcc.o.elf [deleted file]
test/testfiles/penalty_64_clang.o.elf [deleted file]
test/testfiles/penalty_64_gcc.o.elf [deleted file]
test/testfiles/simple_gcc.elf.arm [deleted file]
test/testfiles/update32.o.elf [deleted file]
test/testfiles_for_readelf/exe_simple32.elf [new file with mode: 0644]
test/testfiles_for_readelf/exe_simple64.elf [new file with mode: 0644]
test/testfiles_for_readelf/exe_stripped64.elf [new file with mode: 0644]
test/testfiles_for_readelf/libelf0_8_13_32bit.so.elf [new file with mode: 0644]
test/testfiles_for_readelf/obj_simple32.o.elf [new file with mode: 0644]
test/testfiles_for_readelf/penalty_32_gcc.o.elf [new file with mode: 0644]
test/testfiles_for_readelf/penalty_64_clang.o.elf [new file with mode: 0644]
test/testfiles_for_readelf/penalty_64_gcc.o.elf [new file with mode: 0644]
test/testfiles_for_readelf/update32.o.elf [new file with mode: 0644]
test/testfiles_for_unittests/exe_solaris32_cc.elf [new file with mode: 0644]
test/testfiles_for_unittests/exe_solaris32_cc.elf.sparc [new file with mode: 0644]
test/testfiles_for_unittests/exe_solaris64_cc.elf [new file with mode: 0644]
test/testfiles_for_unittests/exe_solaris64_cc.elf.sparc [new file with mode: 0644]
test/testfiles_for_unittests/simple_gcc.elf.arm [new file with mode: 0644]

index 0c542d88ba4f1d21a54e62a1ecf7673068862ab8..f9d07ac2713f39c8e698ffeaef5b2e2ae1029a35 100755 (executable)
@@ -183,7 +183,7 @@ def main():
     if len(args) > 0:
         filenames = args
     else:
-        filenames = list(discover_testfiles('test/testfiles'))
+        filenames = list(discover_testfiles('test/testfiles_for_readelf'))
 
     success = True
     for filename in filenames:
index b2b0ab290236b8b47b4f17ebbdbabbc9bcf82a5c..0d7bfcc8339b0ed1c1d09e14244c7641c70848b4 100644 (file)
@@ -15,7 +15,7 @@ from elftools.elf.elffile import ELFFile
 
 class TestARMSupport(unittest.TestCase):
     def test_hello(self):
-        with open(os.path.join('test', 'testfiles',
+        with open(os.path.join('test', 'testfiles_for_unittests',
                                'simple_gcc.elf.arm'), 'rb') as f:
             elf = ELFFile(f)
             self.assertEqual(elf.get_machine_arch(), 'ARM')
index 0b7834c24bd423ca6ae6eb62e526cace00686907..59084c98b17d0669b64d9ba19da1a06e0fad7e43 100644 (file)
@@ -18,19 +18,19 @@ from elftools.elf.constants import SYMINFO_FLAGS
 class TestSolarisSupport(unittest.TestCase):
 
     def _test_SUNW_syminfo_section_generic(self, testfile):
-        with open(os.path.join('test', 'testfiles',
+        with open(os.path.join('test', 'testfiles_for_unittests',
                                testfile), 'rb') as f:
             elf = ELFFile(f)
-            syminfo_section = elf.get_section_by_name('.SUNW_syminfo')
+            syminfo_section = elf.get_section_by_name(b'.SUNW_syminfo')
             self.assertIsNotNone(syminfo_section)
 
             # The test files were compiled against libc.so.1 with
-            # direct binding, hence the libc symbols used 
+            # direct binding, hence the libc symbols used
             # (exit, atexit and _exit) have the direct binding flags
             # in the syminfo table.
             # We check that this is properly detected.
             exit_symbols = [s for s in syminfo_section.iter_symbols()
-                            if 'exit' in s.name]
+                            if b'exit' in s.name]
             self.assertNotEqual(len(exit_symbols), 0)
 
             for symbol in exit_symbols:
diff --git a/test/testfiles/exe_simple32.elf b/test/testfiles/exe_simple32.elf
deleted file mode 100644 (file)
index d6b3cd1..0000000
Binary files a/test/testfiles/exe_simple32.elf and /dev/null differ
diff --git a/test/testfiles/exe_simple64.elf b/test/testfiles/exe_simple64.elf
deleted file mode 100644 (file)
index ccfa6ae..0000000
Binary files a/test/testfiles/exe_simple64.elf and /dev/null differ
diff --git a/test/testfiles/exe_solaris32_cc.elf b/test/testfiles/exe_solaris32_cc.elf
deleted file mode 100755 (executable)
index 51b925c..0000000
Binary files a/test/testfiles/exe_solaris32_cc.elf and /dev/null differ
diff --git a/test/testfiles/exe_solaris32_cc.elf.sparc b/test/testfiles/exe_solaris32_cc.elf.sparc
deleted file mode 100755 (executable)
index 7e879ef..0000000
Binary files a/test/testfiles/exe_solaris32_cc.elf.sparc and /dev/null differ
diff --git a/test/testfiles/exe_solaris64_cc.elf b/test/testfiles/exe_solaris64_cc.elf
deleted file mode 100755 (executable)
index b6bad65..0000000
Binary files a/test/testfiles/exe_solaris64_cc.elf and /dev/null differ
diff --git a/test/testfiles/exe_solaris64_cc.elf.sparc b/test/testfiles/exe_solaris64_cc.elf.sparc
deleted file mode 100755 (executable)
index b9e4a17..0000000
Binary files a/test/testfiles/exe_solaris64_cc.elf.sparc and /dev/null differ
diff --git a/test/testfiles/exe_stripped64.elf b/test/testfiles/exe_stripped64.elf
deleted file mode 100644 (file)
index 841b3f8..0000000
Binary files a/test/testfiles/exe_stripped64.elf and /dev/null differ
diff --git a/test/testfiles/libelf0_8_13_32bit.so.elf b/test/testfiles/libelf0_8_13_32bit.so.elf
deleted file mode 100644 (file)
index c236625..0000000
Binary files a/test/testfiles/libelf0_8_13_32bit.so.elf and /dev/null differ
diff --git a/test/testfiles/obj_simple32.o.elf b/test/testfiles/obj_simple32.o.elf
deleted file mode 100644 (file)
index 5ce4182..0000000
Binary files a/test/testfiles/obj_simple32.o.elf and /dev/null differ
diff --git a/test/testfiles/penalty_32_gcc.o.elf b/test/testfiles/penalty_32_gcc.o.elf
deleted file mode 100644 (file)
index 4c5c5de..0000000
Binary files a/test/testfiles/penalty_32_gcc.o.elf and /dev/null differ
diff --git a/test/testfiles/penalty_64_clang.o.elf b/test/testfiles/penalty_64_clang.o.elf
deleted file mode 100644 (file)
index 91d207d..0000000
Binary files a/test/testfiles/penalty_64_clang.o.elf and /dev/null differ
diff --git a/test/testfiles/penalty_64_gcc.o.elf b/test/testfiles/penalty_64_gcc.o.elf
deleted file mode 100644 (file)
index aca100b..0000000
Binary files a/test/testfiles/penalty_64_gcc.o.elf and /dev/null differ
diff --git a/test/testfiles/simple_gcc.elf.arm b/test/testfiles/simple_gcc.elf.arm
deleted file mode 100644 (file)
index b678393..0000000
Binary files a/test/testfiles/simple_gcc.elf.arm and /dev/null differ
diff --git a/test/testfiles/update32.o.elf b/test/testfiles/update32.o.elf
deleted file mode 100644 (file)
index ae68ef9..0000000
Binary files a/test/testfiles/update32.o.elf and /dev/null differ
diff --git a/test/testfiles_for_readelf/exe_simple32.elf b/test/testfiles_for_readelf/exe_simple32.elf
new file mode 100644 (file)
index 0000000..d6b3cd1
Binary files /dev/null and b/test/testfiles_for_readelf/exe_simple32.elf differ
diff --git a/test/testfiles_for_readelf/exe_simple64.elf b/test/testfiles_for_readelf/exe_simple64.elf
new file mode 100644 (file)
index 0000000..ccfa6ae
Binary files /dev/null and b/test/testfiles_for_readelf/exe_simple64.elf differ
diff --git a/test/testfiles_for_readelf/exe_stripped64.elf b/test/testfiles_for_readelf/exe_stripped64.elf
new file mode 100644 (file)
index 0000000..841b3f8
Binary files /dev/null and b/test/testfiles_for_readelf/exe_stripped64.elf differ
diff --git a/test/testfiles_for_readelf/libelf0_8_13_32bit.so.elf b/test/testfiles_for_readelf/libelf0_8_13_32bit.so.elf
new file mode 100644 (file)
index 0000000..c236625
Binary files /dev/null and b/test/testfiles_for_readelf/libelf0_8_13_32bit.so.elf differ
diff --git a/test/testfiles_for_readelf/obj_simple32.o.elf b/test/testfiles_for_readelf/obj_simple32.o.elf
new file mode 100644 (file)
index 0000000..5ce4182
Binary files /dev/null and b/test/testfiles_for_readelf/obj_simple32.o.elf differ
diff --git a/test/testfiles_for_readelf/penalty_32_gcc.o.elf b/test/testfiles_for_readelf/penalty_32_gcc.o.elf
new file mode 100644 (file)
index 0000000..4c5c5de
Binary files /dev/null and b/test/testfiles_for_readelf/penalty_32_gcc.o.elf differ
diff --git a/test/testfiles_for_readelf/penalty_64_clang.o.elf b/test/testfiles_for_readelf/penalty_64_clang.o.elf
new file mode 100644 (file)
index 0000000..91d207d
Binary files /dev/null and b/test/testfiles_for_readelf/penalty_64_clang.o.elf differ
diff --git a/test/testfiles_for_readelf/penalty_64_gcc.o.elf b/test/testfiles_for_readelf/penalty_64_gcc.o.elf
new file mode 100644 (file)
index 0000000..aca100b
Binary files /dev/null and b/test/testfiles_for_readelf/penalty_64_gcc.o.elf differ
diff --git a/test/testfiles_for_readelf/update32.o.elf b/test/testfiles_for_readelf/update32.o.elf
new file mode 100644 (file)
index 0000000..ae68ef9
Binary files /dev/null and b/test/testfiles_for_readelf/update32.o.elf differ
diff --git a/test/testfiles_for_unittests/exe_solaris32_cc.elf b/test/testfiles_for_unittests/exe_solaris32_cc.elf
new file mode 100644 (file)
index 0000000..51b925c
Binary files /dev/null and b/test/testfiles_for_unittests/exe_solaris32_cc.elf differ
diff --git a/test/testfiles_for_unittests/exe_solaris32_cc.elf.sparc b/test/testfiles_for_unittests/exe_solaris32_cc.elf.sparc
new file mode 100644 (file)
index 0000000..7e879ef
Binary files /dev/null and b/test/testfiles_for_unittests/exe_solaris32_cc.elf.sparc differ
diff --git a/test/testfiles_for_unittests/exe_solaris64_cc.elf b/test/testfiles_for_unittests/exe_solaris64_cc.elf
new file mode 100644 (file)
index 0000000..b6bad65
Binary files /dev/null and b/test/testfiles_for_unittests/exe_solaris64_cc.elf differ
diff --git a/test/testfiles_for_unittests/exe_solaris64_cc.elf.sparc b/test/testfiles_for_unittests/exe_solaris64_cc.elf.sparc
new file mode 100644 (file)
index 0000000..b9e4a17
Binary files /dev/null and b/test/testfiles_for_unittests/exe_solaris64_cc.elf.sparc differ
diff --git a/test/testfiles_for_unittests/simple_gcc.elf.arm b/test/testfiles_for_unittests/simple_gcc.elf.arm
new file mode 100644 (file)
index 0000000..b678393
Binary files /dev/null and b/test/testfiles_for_unittests/simple_gcc.elf.arm differ