Support running cross compiled os-test

This commit is contained in:
Wildan M 2025-12-20 13:52:43 +07:00
parent 29bf516500
commit fcb4bb0900
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
3 changed files with 54 additions and 12 deletions

View File

@ -31,6 +31,7 @@ RUN apt-get update \
gtk-doc-tools \
gtk-update-icon-cache \
help2man \
ipxe-qemu \
intltool \
itstool \
libaudiofile-dev \
@ -63,6 +64,9 @@ RUN apt-get update \
pkg-config \
po4a \
protobuf-compiler \
qemu-system-x86 \
qemu-system-arm \
qemu-efi-aarch64 \
python3 \
python3-dev \
python3-mako \

View File

@ -0,0 +1,6 @@
[source]
git = "https://gitlab.redox-os.org/willnode/redoxer"
branch = "artifact-opt"
[build]
template = "cargo"

View File

@ -1,18 +1,50 @@
# Must be run on host: "make r.host:os-test-result"
[source]
git = "https://gitlab.redox-os.org/redox-os/os-test-relibc"
script = """
# update automatically
cd relibc && git pull origin master
"""
same_as = "../os-test"
[build]
template = "custom"
dev-dependencies = [
"host:redoxer",
"gnu-grep",
"gnu-make",
"libarchive",
"sed",
]
script = """
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
mkdir -p {COOKBOOK_STAGE}/share/os-test
./linux.sh
mv os-test/html ${COOKBOOK_STAGE}/share/os-test/html
mv os-test/out ${COOKBOOK_STAGE}/share/os-test/out
mv os-test/os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json
rsync -a "${COOKBOOK_SOURCE}/" ./
case "$(echo "${TARGET}" | cut -d - -f3)" in
linux) OS=Linux;;
redox) OS=Redox;;
esac
make OS=${OS} CC="${CC}" CFLAGS= CPPFLAGS= \
LDFLAGS= EXTRA_LDFLAGS= \
CC_FOR_BUILD="${CC_WRAPPER} cc" CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \
LDFLAGS_FOR_BUILD= all
skips=(
# Skip fputc_unlocked, hanging on Linux with relibc
basic/stdio/putc_unlocked
)
for skip in "${skips[@]}"
do
mkdir -p out.known/{linux,redox}/"$(dirname "${skip}")"
echo "skipped" > out.known/linux/"${skip}.out"
echo "skipped" > out.known/redox/"${skip}.out"
done
cp -t out -R out.known/linux
cp -t out -R out.known/redox
if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then
make test
else
redoxer exec --folder . --folder ${COOKBOOK_SYSROOT}/usr/:/usr --artifact . make test
fi
make html json jsonl
mkdir -p ${COOKBOOK_STAGE}/share/os-test
mv html ${COOKBOOK_STAGE}/share/os-test/html
mv out ${COOKBOOK_STAGE}/share/os-test/out
mv os-test.json ${COOKBOOK_STAGE}/share/os-test/os-test.json
"""