From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/filebytes/
Date: Sat, 17 May 2025 11:32:04 +0000 (UTC) [thread overview]
Message-ID: <1747481467.cf53d4052b51e7cdaf55638f63c44b3af6c5726b.arthurzam@gentoo> (raw)
commit: cf53d4052b51e7cdaf55638f63c44b3af6c5726b
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat May 17 11:31:07 2025 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> 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 <arthurzam <AT> 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
+}
next reply other threads:[~2025-05-17 11:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-17 11:32 Arthur Zamarin [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-05-17 11:32 [gentoo-commits] repo/gentoo:master commit in: dev-python/filebytes/ Arthur Zamarin
2024-08-29 3:23 Sam James
2023-09-18 7:40 Sam James
2023-04-14 19:43 Sam James
2023-04-14 4:04 Sam James
2023-02-25 5:47 Arthur Zamarin
2023-02-08 4:11 Sam James
2023-01-14 10:00 Arthur Zamarin
2022-08-15 23:10 Sam James
2022-08-15 23:10 Sam James
2022-07-15 0:45 Sam James
2022-04-10 17:01 Sam James
2022-01-28 8:22 Sam James
2022-01-28 5:18 Sam James
2022-01-28 5:18 Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1747481467.cf53d4052b51e7cdaf55638f63c44b3af6c5726b.arthurzam@gentoo \
--to=arthurzam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox