capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.61k stars 1.56k forks source link

5.0.1: pytest is failing and deprecation warnings #2235

Open kloczek opened 10 months ago

kloczek commented 10 months ago
```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/capstone-5.0.1-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/capstone-5.0.1-3.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ============================= test session starts ============================== platform linux -- Python 3.8.18, pytest-7.4.4, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/capstone-5.0.1/bindings/python collected 27 items test_arm.py . [ 3%] test_arm64.py . [ 7%] test_basic.py F.. [ 18%] test_bpf.py . [ 22%] test_customized_mnem.py . [ 25%] test_detail.py . [ 29%] test_evm.py . [ 33%] test_lite.py .. [ 40%] test_m680x.py . [ 44%] test_m68k.py . [ 48%] test_mips.py . [ 51%] test_mos65xx.py . [ 55%] test_ppc.py . [ 59%] test_riscv.py . [ 62%] test_sh.py . [ 66%] test_skipdata.py E. [ 74%] test_sparc.py . [ 77%] test_systemz.py . [ 81%] test_tms320c64x.py . [ 85%] test_tricore.py . [ 88%] test_wasm.py . [ 92%] test_x86.py . [ 96%] test_xcore.py . [100%] ==================================== ERRORS ==================================== ___________________________ ERROR at setup of testcb ___________________________ file /home/tkloczko/rpmbuild/BUILD/capstone-5.0.1/bindings/python/test_skipdata.py, line 21 def testcb(buffer, size, offset, userdata): E fixture 'buffer' not found > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory > use 'pytest --fixtures [testpath]' for help on them. /home/tkloczko/rpmbuild/BUILD/capstone-5.0.1/bindings/python/test_skipdata.py:21 =================================== FAILURES =================================== _____________________________ test_cs_disasm_quick _____________________________ def test_cs_disasm_quick(): for arch, mode, code, comment, syntax in all_tests: print('*' * 40) print("Platform: %s" % comment) print("Disasm:"), print(to_hex(code)) for insn in cs_disasm_quick(arch, mode, code, 0x1000): > print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str)) test_basic.py:82: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[CsError(7) raised in repr()] CsInsn object at 0x7f5a36b0d4f0> name = 'mnemonic' def __getattr__(self, name): if not self._cs._detail: > raise CsError(CS_ERR_DETAIL) E capstone.CsError: Details are unavailable (CS_ERR_DETAIL) capstone/__init__.py:799: CsError ----------------------------- Captured stdout call ----------------------------- **************************************** Platform: X86 16bit (Intel syntax) Disasm: 0x8d 0x4c 0x32 0x08 0x01 0xd8 0x81 0xc6 0x34 0x12 0x00 0x00 =============================== warnings summary =============================== capstone/__init__.py:380 /home/tkloczko/rpmbuild/BUILD/capstone-5.0.1/bindings/python/capstone/__init__.py:380: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ ERROR test_skipdata.py::testcb FAILED test_basic.py::test_cs_disasm_quick - capstone.CsError: Details are un... =============== 1 failed, 25 passed, 1 warning, 1 error in 0.77s =============== ```

Do I have something missing in my build env? 🤔

Rot127 commented 10 months ago

Did you compile with the CAPSTONE_DIET option? This disables most details.

kloczek commented 10 months ago

You mean .. CAPSTONE_BUILD_DIET? By default this option is OFF

-- Cache values
BUILD_SHARED_LIBS:BOOL=ON
CAPSTONE_ARCHITECTURE_DEFAULT:BOOL=ON
CAPSTONE_ARM64_SUPPORT:BOOL=ON
CAPSTONE_ARM_SUPPORT:BOOL=ON
CAPSTONE_BPF_SUPPORT:BOOL=ON
CAPSTONE_BUILD_CSTEST:BOOL=OFF
CAPSTONE_BUILD_CSTOOL:BOOL=ON
CAPSTONE_BUILD_DIET:BOOL=OFF
CAPSTONE_BUILD_STATIC_RUNTIME:BOOL=ON
CAPSTONE_BUILD_TESTS:BOOL=ON
CAPSTONE_DEBUG:BOOL=OFF
CAPSTONE_EVM_SUPPORT:BOOL=ON
CAPSTONE_INSTALL:BOOL=ON
CAPSTONE_M680X_SUPPORT:BOOL=ON
CAPSTONE_M68K_SUPPORT:BOOL=ON
CAPSTONE_MIPS_SUPPORT:BOOL=ON
CAPSTONE_MOS65XX_SUPPORT:BOOL=ON
CAPSTONE_OSXKERNEL_SUPPORT:BOOL=OFF
CAPSTONE_PPC_SUPPORT:BOOL=ON
CAPSTONE_RISCV_SUPPORT:BOOL=ON
CAPSTONE_SH_SUPPORT:BOOL=ON
CAPSTONE_SPARC_SUPPORT:BOOL=ON
CAPSTONE_SYSZ_SUPPORT:BOOL=ON
CAPSTONE_TMS320C64X_SUPPORT:BOOL=ON
CAPSTONE_TRICORE_SUPPORT:BOOL=ON
CAPSTONE_USE_DEFAULT_ALLOC:BOOL=ON
CAPSTONE_WASM_SUPPORT:BOOL=ON
CAPSTONE_X86_ATT_DISABLE:BOOL=OFF
CAPSTONE_X86_REDUCE:BOOL=OFF
CAPSTONE_X86_SUPPORT:BOOL=ON
CAPSTONE_XCORE_SUPPORT:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr