From 9757ce312de4c425567c2fcc55991ab5828773cd Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Tue, 17 Dec 2019 21:42:03 -0700 Subject: Move smoketest to tests dir --- tests/smoketest.gdbinit | 15 +++++++++++++++ tests/smoketest.sh | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/smoketest.gdbinit create mode 100755 tests/smoketest.sh (limited to 'tests') diff --git a/tests/smoketest.gdbinit b/tests/smoketest.gdbinit new file mode 100644 index 0000000..8560b5a --- /dev/null +++ b/tests/smoketest.gdbinit @@ -0,0 +1,15 @@ +set pagination off +symbol-file gdbstub.elf +target remote 127.0.0.1:1234 +b simple_loop +c + +# Step twice and check value of `x` variable +s 2 +if x == 0xdeadbeef + printf "PASS\n" + quit 0 +else + printf "FAIL\n" + quit 1 +end diff --git a/tests/smoketest.sh b/tests/smoketest.sh new file mode 100755 index 0000000..0ae8ccd --- /dev/null +++ b/tests/smoketest.sh @@ -0,0 +1,16 @@ +#!/bin/bash +echo "Launching QEMU" +qemu-system-i386 \ + -serial tcp:127.0.0.1:1234,server \ + -display none \ + -kernel gdbstub.bin & +sleep 1 + +echo "Running GDB" +gdb --command tests/smoketest.gdbinit +RESULT=$? + +echo "Terminating QEMU" +killall qemu-system-i386 + +exit $RESULT -- cgit v1.2.3