diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/machine-unit-tests/Makefile | 5 | ||||
-rw-r--r-- | tests/machine-unit-tests/data.S | 6 | ||||
-rwxr-xr-x | tests/machine-unit-tests/test.sh | 2 | ||||
-rw-r--r-- | tests/t-registers/Makefile | 5 | ||||
-rw-r--r-- | tests/test.sh | 5 |
5 files changed, 21 insertions, 2 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!" diff --git a/tests/t-registers/Makefile b/tests/t-registers/Makefile new file mode 100644 index 0000000..b8278d1 --- /dev/null +++ b/tests/t-registers/Makefile @@ -0,0 +1,5 @@ +MAKEFLAGS += --no-builtin-rules + +SRC = registers.S + +include ../test.mk diff --git a/tests/test.sh b/tests/test.sh index aad0f5a..34b42e3 100644 --- a/tests/test.sh +++ b/tests/test.sh @@ -66,10 +66,11 @@ TEST_DIR="$TEST_DIR_ROOT/$TEST_NAME" qtmips_make() { mkdir -p "$BUILD_DIR" - pushd "$BUILD_DIR" >/dev/null + local ORIG="$(pwd)" + cd "$BUILD_DIR" /usr/lib64/qt5/bin/qmake "$PROJECT_ROOT" || echo_fail "QtMips qmake failed!" make "$@" || echo_fail "QtMips build failed! (target: $@)" - popd >/dev/null + cd "$ORIG" } qtmips_run() { |