aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Common.mk10
-rwxr-xr-xtests/run.sh4
-rwxr-xr-xtests/test1.bash9
-rwxr-xr-xtests/test1.sh10
4 files changed, 22 insertions, 11 deletions
diff --git a/Common.mk b/Common.mk
index 8ef25af..9852b2d 100644
--- a/Common.mk
+++ b/Common.mk
@@ -34,7 +34,7 @@ endif
CFLAGS += -DVERSION="\"0.1b\""
-.PHONY: clean run run-debug debug export tree disk
+.PHONY: clean run run-silent run-debug debug export tree disk test
default: clean build/kernel7.img
@@ -70,6 +70,10 @@ run: build/kernel.elf
@tput setaf 6 2> /dev/null || true; echo Starting QEMU; tput sgr0 2> /dev/null || true
@${QEMU} -kernel $< ${QFLAGS}
+run-silent: build/kernel.elf
+ @tput setaf 6 2> /dev/null || true; echo Starting QEMU; tput sgr0 2> /dev/null || true
+ @${QEMU} -kernel $< -nographic ${QFLAGS}
+
run-debug: build/kernel-g.elf
@echo Starting QEMU in Debug Mode
@${QEMU} -kernel $< -s -S ${QFLAGS}
@@ -88,3 +92,7 @@ clean:
tree:
@tree -a -I obj\|build\|.git\|.gitignore
+
+test: clean build/kernel.elf
+ @tput setaf 6 2> /dev/null || true; echo Running Tests; tput sgr0 2> /dev/null || true
+ @./tests/run.sh
diff --git a/tests/run.sh b/tests/run.sh
new file mode 100755
index 0000000..80217e8
--- /dev/null
+++ b/tests/run.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+for file in ./tests/*.bash; do
+ ${file}
+done
diff --git a/tests/test1.bash b/tests/test1.bash
new file mode 100755
index 0000000..d04af60
--- /dev/null
+++ b/tests/test1.bash
@@ -0,0 +1,9 @@
+#!/bin/bash
+rm -f l.test1.log
+make run-silent &
+cat guest.out >> l.test1.log &
+sleep 0.5
+printf "ab" >> guest.in
+sleep 1
+printf "\001x" >> guest.in
+sleep 0.5
diff --git a/tests/test1.sh b/tests/test1.sh
deleted file mode 100755
index 2641953..0000000
--- a/tests/test1.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/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