diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | devices/Makefile | 2 | ||||
-rw-r--r-- | i686/Makefile | 3 | ||||
-rw-r--r-- | lib/Makefile | 15 | ||||
-rw-r--r-- | rules.mk | 8 | ||||
-rwxr-xr-x | scripts/test_runner.py | 6 | ||||
-rw-r--r-- | src/Makefile | 6 |
7 files changed, 31 insertions, 11 deletions
@@ -42,11 +42,13 @@ clean: test: @make -C ${ARCH} test.quiet @make -C lib test.quiet + @make -C devices test.quiet @make -C src test.quiet valgrind: @make -C ${ARCH} valgrind.quiet @make -C lib valgrind.quiet + @make -C devices valgrind.quiet @make -C src valgrind.quiet # configure targets diff --git a/devices/Makefile b/devices/Makefile index 8040bec..3222ad8 100644 --- a/devices/Makefile +++ b/devices/Makefile @@ -10,7 +10,7 @@ devs.SRCS = pic_8259.c uart/uart_16550.c vga.c i8042.c pckbd.c mouse.c HOSTTARGETBIN += uart/test_uart_16550 uart/test_uart_16550.SRCS = uart/uart_16550.c uart/unittest_uart_16550.cc -#TESTS += uart/test_uart_16550 +TESTS += uart/test_uart_16550 include ../rules.mk diff --git a/i686/Makefile b/i686/Makefile index ede39f0..93f9a63 100644 --- a/i686/Makefile +++ b/i686/Makefile @@ -9,6 +9,9 @@ arch.SRCS = boot.S init.s \ gdt.c lgdt.c \ lidt.c isr.c +HOSTTARGETBIN += test_gdt +test_gdt.SRCS = test_gdt.cc + TESTS += test_gdt include ../rules.mk diff --git a/lib/Makefile b/lib/Makefile index 1301e04..0494a85 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -8,6 +8,18 @@ libk.SRCS = \ libk/stdlib/memcpy.c libk/stdlib/memset.c libk/stdlib/linked_list_allocator.c \ libk/string/itoa.c +HOSTTARGETBIN += libk/endian/test_endian_little +libk/endian/test_endian_little.SRCS = libk/endian/test_endian_little.cc + +HOSTTARGETBIN += libk/stdlib/test_linked_list_allocator +libk/stdlib/test_linked_list_allocator.SRCS = libk/stdlib/test_linked_list_allocator.cc + +HOSTTARGETBIN += libk/stdlib/test_mem +libk/stdlib/test_mem.SRCS = libk/stdlib/test_mem.cc + +HOSTTARGETBIN += libk/string/test_string +libk/string/test_string.SRCS = libk/string/test_string.cc + TESTS += \ libk/endian/test_endian_little \ libk/stdlib/test_linked_list_allocator libk/stdlib/test_mem \ @@ -17,6 +29,9 @@ TESTS += \ TARGETLIB += blake2 blake2.SRCS = blake2/blake2s.c +HOSTTARGETBIN += blake2/test_blake2s_selftest +blake2/test_blake2s_selftest.SRCS = blake2/test_blake2s_selftest.cc + TESTS += blake2/test_blake2s_selftest include ../rules.mk @@ -41,9 +41,6 @@ $(foreach T,${HOSTTARGETBIN},\ $(eval DEFAULT_TARGETS += $T) \ ) -TESTS.DEPS = $(foreach F,${TESTS},$(addsuffix .d,$F)) -include ${TESTS.DEPS} - debug: @echo "TARGETBIN ${TARGETBIN}" @echo "TARGETLIB ${TARGETLIB}" @@ -114,11 +111,6 @@ ${ARCH}_CXXFLAGS += -I../lib/libk -Drestrict=__restrict__ @echo ' HOST CXX $<' @${HOST_CXX} ${HOST_CXXFLAGS} -c -o $@ $< -# test rules -test_%: test_%.cc - @echo ' CXX TEST $@' - @${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_LDFLAGS} $< -o $@ - .PHONY: test test.quiet valgrind valgrind.quiet clean.base FORCE test: ${TESTS} @echo " -> Running tests in $(shell pwd | xargs basename)" diff --git a/scripts/test_runner.py b/scripts/test_runner.py index 80c3e30..53bebd3 100755 --- a/scripts/test_runner.py +++ b/scripts/test_runner.py @@ -25,9 +25,11 @@ def main(): cmd.append(os.path.join(cwd, test)) #print(cmd) - print(f' {test:.<48}', end='') + if not args.verbose: + print(f' {test:.<48}', end='') result = subprocess.run(cmd, capture_output=not args.verbose, check=False) - print('ok' if result.returncode == 0 else 'failed') + if not args.verbose: + print('ok' if result.returncode == 0 else 'failed') if result.returncode != 0: fail_count += 1 diff --git a/src/Makefile b/src/Makefile index 9f98d92..0d02c5d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,6 +7,12 @@ ${ARCH}_CXXFLAGS += ${INCLUDES} TARGETLIB += kernel kernel.SRCS := multiboot2.c mmap.c kernel.cpp mem/vmm.c +HOSTTARGETBIN += sched/test_taskqueue +sched/test_taskqueue.SRCS = sched/test_taskqueue.cc + +HOSTTARGETBIN += sched/test_roundrobin +sched/test_roundrobin.SRCS = sched/test_roundrobin.cc + TESTS += \ sched/test_taskqueue sched/test_roundrobin |