diff --git a/tests/test_example_elfs.py b/tests/test_example_elfs.py index 5cfb445..6fa631a 100644 --- a/tests/test_example_elfs.py +++ b/tests/test_example_elfs.py @@ -1,11 +1,15 @@ import pelfy import glob + def known_name(text: str): return not text.isnumeric() and not text.startswith('0x') + def test_simple_c(): - for path in glob.glob('tests/obj/*.o'): + file_list = glob.glob('tests/obj/*.o') + assert file_list, "No test object files found" + for path in file_list: print(f'Open {path}...') elf = pelfy.open_elf_file(path) @@ -24,5 +28,6 @@ def test_simple_c(): for reloc in elf.get_relocations(): assert known_name(reloc.type), f"Relocation type {reloc.type} for {elf.architecture} in {path} is unknown." + if __name__ == '__main__': test_simple_c()