diff options
author | Marvin Borner | 2020-09-03 18:47:38 +0200 |
---|---|---|
committer | Marvin Borner | 2020-09-03 18:47:38 +0200 |
commit | 15a8cb8fa64b12d6c0b65eafb226971cd66dc3cd (patch) | |
tree | 10669f647c05299601497c277b2d4d4e89c4c9af /run | |
parent | d79b7492910d4a77b8c3a70f28c5ea4c81a0b2e5 (diff) |
Moved test to app
Diffstat (limited to 'run')
-rwxr-xr-x | run | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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 |