Skip to content

Commit

Permalink
meta-oe: recipes-extended: bitwise: Add ptest
Browse files Browse the repository at this point in the history
Signed-off-by: Ever ATILANO <ever.atilano@smile.fr>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Reviewed-by: Frank WOLFF <frank.wolff@smile.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
Ever ATILANO authored and kraj committed Apr 6, 2023
1 parent 8986c10 commit f19dac1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
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

0 comments on commit f19dac1

Please sign in to comment.