From ef262d9a0b4b4d973e3c0fcabc9cdf4d57fc93ce Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Tue, 22 Feb 2022 12:33:10 -0700 Subject: Automate Testing --- .gitignore | 2 +- Common.mk | 4 ++-- tests/test1.sh | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 tests/test1.sh diff --git a/.gitignore b/.gitignore index 395c0bf..473da30 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ build/ obj/ mk.old Makefile -serial.log +*.log *.swp *.hda diff --git a/Common.mk b/Common.mk index dba0faa..8ef25af 100644 --- a/Common.mk +++ b/Common.mk @@ -16,8 +16,8 @@ GDB = gdb-multiarch CFLAGS = -mcpu=cortex-a7 -fpic -ffreestanding -std=gnu99 -O3 -Wall -Wextra -nostdlib -Iinclude -g AFLAGS = -mcpu=cortex-a7 -Iinclude -g QFLAGS = -M raspi2b -cpu cortex-a7 -m 1G -QFLAGS += -chardev stdio,id=char0,mux=on,logfile=serial.log,signal=off -serial chardev:char0 -mon chardev=char0 -#QFLAGS += -serial pipe:/tmp/guest +#QFLAGS += -chardev stdio,id=char0,mux=on,logfile=serial.log,signal=off -serial chardev:char0 -mon chardev=char0 +QFLAGS += -chardev pipe,id=char0,mux=on,logfile=serial.log,path=guest -serial chardev:char0 -mon chardev=char0 QFLAGS += -device usb-kbd ifneq ("$(wildcard ./sd.hda)","") QFLAGS += -drive file=sd.hda,if=sd,format=raw diff --git a/tests/test1.sh b/tests/test1.sh new file mode 100755 index 0000000..2641953 --- /dev/null +++ b/tests/test1.sh @@ -0,0 +1,10 @@ +#!/bin/bash +pushd ./ +rm -f test1.log +make run & +cat guest.out >> test1.log & +sleep 1 +printf "ab" >> guest.in +sleep 2 +printf "\001x" >> guest.in +popd -- cgit v1.2.1