aboutsummaryrefslogtreecommitdiff
path: root/libc/ci/test-runner-linux
blob: 5f1fb237c28eadce3b8b16791da228484a83e0c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

arch=$1
prog=$2

cd /qemu/init
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=/prog > output || true

# remove kernel messages
tr -d '\r' < output | egrep -v '^\['

grep PASSED output > /dev/null