redox/recipes/tests/os-test-bins/recipe.toml
2026-01-09 15:05:00 -07:00

62 lines
1.3 KiB
TOML

[source]
same_as = "../os-test"
[build]
template = "custom"
script = """
DYNAMIC_INIT
# Copy source to /usr/share/os-test
mkdir -p "${COOKBOOK_STAGE}/usr/share/os-test"
cd "${COOKBOOK_STAGE}/usr/share/os-test"
rsync -a "${COOKBOOK_SOURCE}/" "./"
# Pre-compile tests for Redox
make OS=Redox CC="${CC_WRAPPER} ${GNU_TARGET}-gcc" \
CFLAGS= CPPFLAGS= \
LDFLAGS= EXTRA_LDFLAGS= \
CC_FOR_BUILD="${CC_WRAPPER} cc" CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \
LDFLAGS_FOR_BUILD= -j ${COOKBOOK_MAKE_JOBS} all
skips=(
# These tests hang
signal/ppoll-block-sleep-raise-write
signal/ppoll-block-sleep-write-raise
)
for skip in "${skips[@]}"
do
mkdir -p out.known/redox/"$(dirname "${skip}")"
echo "skipped" > out.known/redox/"${skip}.out"
done
cp -t out -R out.known/redox
# Create runner script
mkdir -p "${COOKBOOK_STAGE}/usr/bin"
cat > "${COOKBOOK_STAGE}/usr/bin/os-test-runner" <<EOF
#!/usr/bin/env bash
set -e
cd /usr/share/os-test
echo "Ensuring executables are newer than sources"
find . -type f -perm /111 -exec touch '{}' ';'
echo "Ensuring outputs are newer than sources and executables"
find out -type f -exec touch '{}' ';'
make test
EOF
chmod +x "${COOKBOOK_STAGE}/usr/bin/os-test-runner"
"""
[package]
dependencies = [
"gcc13",
"gnu-binutils",
"gnu-grep",
"gnu-make",
"libarchive",
"sed",
]