Files
libc-hos/ci/test-runner-linux
Trevor Gross 59a18de777 ci: Set -u (error on unset) in all script files
This is a pretty common flag to reduce errors. Make use of it here.
2024-11-18 15:51:08 -05:00

26 lines
494 B
Bash
Executable File

#!/bin/sh
set -eux
arch="$1"
prog="$2"
cd /qemu/init
echo "#!/bin/sh\n/prog --color=never" > run_prog.sh
chmod +x run_prog.sh
cp -f $2 prog
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
cd ..
timeout 30s qemu-system-$arch \
-m 1024 \
-nographic \
-kernel kernel \
-initrd initrd.gz \
-append init=/run_prog.sh > output || true
# remove kernel messages
tr -d '\r' < output | grep -Ev '^\['
grep -E "(PASSED)|(test result: ok)" output > /dev/null