mirror of
https://github.com/openharmony/third_party_rust_libc.git
synced 2026-07-16 03:44:12 -04:00
0e57942c36
Signed-off-by: ljy9810 <longjianyin@h-partners.com>
26 lines
494 B
Bash
Executable File
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
|