Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion meta-oe/recipes-extended/bitwise/bitwise_0.43.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
}

13 changes: 13 additions & 0 deletions meta-oe/recipes-extended/bitwise/files/ptest.out.expected
Original file line number Diff line number Diff line change
@@ -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

11 changes: 11 additions & 0 deletions meta-oe/recipes-extended/bitwise/files/run-ptest
Original file line number Diff line number Diff line change
@@ -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