Added unit testing

This commit is contained in:
2023-10-08 21:50:06 +02:00
parent ce1729d5b1
commit 72dda9aaeb
10 changed files with 192 additions and 0 deletions

22
tests/Makefile Normal file
View File

@@ -0,0 +1,22 @@
AS=riscv32-elf-as
LD=riscv32-elf-ld
BUILD_DIR=../build/tests/
S_FILES := $(shell find ./ -name '*.s')
NAMES = $(basename $(S_FILES))
OBJECTS=$(patsubst %, $(BUILD_DIR)/%, $(NAMES))
all: $(OBJECTS) run
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/%.o: %.s | $(BUILD_DIR)
$(AS) $^ -o $@
$(BUILD_DIR)/%: $(BUILD_DIR)/%.o | $(BUILD_DIR)
$(LD) $^ -o $@ -nostdlib
.SILENT: run
run:
bash test.sh