From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6E92F158287 for ; Sat, 17 May 2025 11:32:07 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 59E10343229 for ; Sat, 17 May 2025 11:32:07 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 5B95F110286; Sat, 17 May 2025 11:32:06 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 5324B110286 for ; Sat, 17 May 2025 11:32:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0C4EE343229 for ; Sat, 17 May 2025 11:32:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9E9A4ECC for ; Sat, 17 May 2025 11:32:04 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1747481467.cf53d4052b51e7cdaf55638f63c44b3af6c5726b.arthurzam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/filebytes/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/filebytes/filebytes-0.10.2.ebuild dev-python/filebytes/filebytes-9999.ebuild X-VCS-Directories: dev-python/filebytes/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: cf53d4052b51e7cdaf55638f63c44b3af6c5726b X-VCS-Branch: master Date: Sat, 17 May 2025 11:32:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cbe20c15-f3fa-4df9-9d41-0ca2e2047015 X-Archives-Hash: 0a20793996b526c07a711b3d12a4b56b commit: cf53d4052b51e7cdaf55638f63c44b3af6c5726b Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 17 11:31:07 2025 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Sat May 17 11:31:07 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf53d405 dev-python/filebytes: add custom tests I've copied some minimal tests from the examples given in readme. Signed-off-by: Arthur Zamarin gentoo.org> dev-python/filebytes/filebytes-0.10.2.ebuild | 14 +++++++++++++- dev-python/filebytes/filebytes-9999.ebuild | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dev-python/filebytes/filebytes-0.10.2.ebuild b/dev-python/filebytes/filebytes-0.10.2.ebuild index d7a86490fd24..0a8b30b7fa52 100644 --- a/dev-python/filebytes/filebytes-0.10.2.ebuild +++ b/dev-python/filebytes/filebytes-0.10.2.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -21,3 +21,15 @@ fi LICENSE="BSD" SLOT="0" + +python_test() { + "${EPYTHON}" - <<-EOF || die "Tests failed with ${EPYTHON}" + from filebytes.elf import * + elf_file = ELF('test-binaries/ls-x86') + print("elf", elf_file.elfHeader, elf_file.sections, elf_file.segments) + + from filebytes.pe import * + pe_file = PE('test-binaries/cmd-x86.exe') + print("pe", pe_file.imageDosHeader, pe_file.sections) + EOF +} diff --git a/dev-python/filebytes/filebytes-9999.ebuild b/dev-python/filebytes/filebytes-9999.ebuild index 21b8aecc4927..3dd61d92280a 100644 --- a/dev-python/filebytes/filebytes-9999.ebuild +++ b/dev-python/filebytes/filebytes-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -21,3 +21,15 @@ fi LICENSE="BSD" SLOT="0" + +python_test() { + "${EPYTHON}" - <<-EOF || die "Tests failed with ${EPYTHON}" + from filebytes.elf import * + elf_file = ELF('test-binaries/ls-x86') + print("elf", elf_file.elfHeader, elf_file.sections, elf_file.segments) + + from filebytes.pe import * + pe_file = PE('test-binaries/cmd-x86.exe') + print("pe", pe_file.imageDosHeader, pe_file.sections) + EOF +}