aboutsummaryrefslogtreecommitdiff
path: root/tests/machine-unit-tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/machine-unit-tests')
-rw-r--r--tests/machine-unit-tests/Makefile5
-rw-r--r--tests/machine-unit-tests/data.S6
-rwxr-xr-xtests/machine-unit-tests/test.sh2
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/machine-unit-tests/Makefile b/tests/machine-unit-tests/Makefile
new file mode 100644
index 0000000..18f7932
--- /dev/null
+++ b/tests/machine-unit-tests/Makefile
@@ -0,0 +1,5 @@
+include ../test.mk
+
+SRC_data = data.S
+
+$(eval $(call MIPS_ELF,data))
diff --git a/tests/machine-unit-tests/data.S b/tests/machine-unit-tests/data.S
new file mode 100644
index 0000000..d61d81d
--- /dev/null
+++ b/tests/machine-unit-tests/data.S
@@ -0,0 +1,6 @@
+.text
+.globl _start
+
+_start:
+ addi $1, $0, 6
+ j _start
diff --git a/tests/machine-unit-tests/test.sh b/tests/machine-unit-tests/test.sh
index 2f06965..8378eff 100755
--- a/tests/machine-unit-tests/test.sh
+++ b/tests/machine-unit-tests/test.sh
@@ -9,5 +9,7 @@ qtmips_make sub-qtmips_machine-tests
# Build test data
mips_make_test
+cd "$TEST_DIR"
+
# Run unit tests
qtmips_run qtmips_machine/tests/tst_machine || echo_fail "Test $TEST_NAME failed!"