aboutsummaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
Diffstat (limited to 'run')
-rwxr-xr-xrun15
1 files changed, 9 insertions, 6 deletions
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