From 59151b2dbb441a3901dd67f51e72ed28b18e6d5d Mon Sep 17 00:00:00 2001 From: Ever ATILANO Date: Fri, 24 Mar 2023 15:45:32 +0100 Subject: [PATCH] meta-oe: recipes-extended: bitwise: Add ptest Signed-off-by: Ever ATILANO Signed-off-by: Yoann Congal Reviewed-by: Frank WOLFF --- meta-oe/recipes-extended/bitwise/bitwise_0.43.bb | 10 +++++++++- .../bitwise/files/ptest.out.expected | 13 +++++++++++++ meta-oe/recipes-extended/bitwise/files/run-ptest | 11 +++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-extended/bitwise/files/ptest.out.expected create mode 100755 meta-oe/recipes-extended/bitwise/files/run-ptest diff --git a/meta-oe/recipes-extended/bitwise/bitwise_0.43.bb b/meta-oe/recipes-extended/bitwise/bitwise_0.43.bb index 713492b44f8..3a9943916e4 100644 --- a/meta-oe/recipes-extended/bitwise/bitwise_0.43.bb +++ b/meta-oe/recipes-extended/bitwise/bitwise_0.43.bb @@ -12,6 +12,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" SRC_URI = "https://github.com/mellowcandle/bitwise/releases/download/v${PV}/bitwise-v${PV}.tar.gz \ file://0001-makefile.am-Fix-build-when-build-dir-is-not-same-as-.patch \ + file://run-ptest \ + file://ptest.out.expected \ " SRC_URI[sha256sum] = "f524f794188a10defc4df673d8cf0b3739f93e58e93aff0cdb8a99fbdcca2ffb" @@ -21,4 +23,10 @@ S = "${WORKDIR}/${BPN}-v${PV}" DEPENDS = "ncurses readline" -inherit autotools +inherit autotools ptest + +do_install_ptest() { + install -d ${D}${PTEST_PATH} + install -m 0644 ${WORKDIR}/ptest.out.expected ${D}${PTEST_PATH}/ptest.out.expected +} + diff --git a/meta-oe/recipes-extended/bitwise/files/ptest.out.expected b/meta-oe/recipes-extended/bitwise/files/ptest.out.expected new file mode 100644 index 00000000000..c5ca3e52151 --- /dev/null +++ b/meta-oe/recipes-extended/bitwise/files/ptest.out.expected @@ -0,0 +1,13 @@ +Unsigned decimal: 66 +Signed decimal: 66 +Hexadecimal: 0x42 +Octal: 0102 +Human: 66 +Radix64: 0/ +IPv4 (Network byte order - Big): 66.0.0.0 +IPv4 (Reverwsed byte order - Little): 0.0.0.66 +ASCII: .......B +Binary: +0 1 0 0 0 0 1 0 + 7 - 0 + diff --git a/meta-oe/recipes-extended/bitwise/files/run-ptest b/meta-oe/recipes-extended/bitwise/files/run-ptest new file mode 100755 index 00000000000..c29e1eaddc7 --- /dev/null +++ b/meta-oe/recipes-extended/bitwise/files/run-ptest @@ -0,0 +1,11 @@ +#!/bin/sh + +# Test 1: Basic bitwise operation +bitwise --no-color -w b 0x42 > test.out + +# Compare expected output with actual output + +if ! cmp test.out ptest.out.expected; then + echo "[FAIL] Test 1: Basic bitwise operation" + exit 1 +fi