From 15a8cb8fa64b12d6c0b65eafb226971cd66dc3cd Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 3 Sep 2020 18:47:38 +0200 Subject: Moved test to app --- run | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'run') diff --git a/run b/run index c302fa9..ecf06ad 100755 --- a/run +++ b/run @@ -89,11 +89,7 @@ make_build() { rm -rf build/* printf "\nBuilding...\n" - if [ "$mode" = "test" ]; then - make test - else - make - fi + make # Create disk image dd if=/dev/zero of=build/disk.img bs=1k count=32k status=none @@ -103,6 +99,11 @@ make_build() { ./ext2util/ext2util -x build/disk.img -wf kernel.bin -i 5 >/dev/null rm kernel.bin + # Set test app as init + if [ "$mode" = "test" ]; then + cp build/apps/test build/apps/init + fi + mkdir -p mnt/ sudo mount build/disk.img mnt/ sudo cp -r disk/* mnt/ @@ -115,9 +116,11 @@ make_build() { make_test() { if [ "$mode" = "test" ]; then - qemu_with_flags -nographic -drive file=build/disk.img,format=raw,index=1,media=disk & + qemu_with_flags -serial file:test.log -nographic -drive file=build/disk.img,format=raw,index=1,media=disk & sleep 2 killall -9 qemu-system-i386 + grep -E 'PASS|FAIL' test.log + exit $(grep -q "All tests passed" test.log) else qemu_with_flags -serial stdio -drive file=build/disk.img,format=raw,index=1,media=disk fi -- cgit v1.2.3