From b770132cdb8e79f27f3d429f24d94284dd6fe970 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 14 Feb 2013 11:17:03 +0800 Subject: [PATCH] Usermode - Unit tests called from root makefile --- .travis.yml | 6 +++--- Makefile | 10 ++++++++++ Usermode/Libraries/Makefile.tpl | 2 ++ Usermode/Libraries/acess.ld_src/Makefile | 4 +++- Usermode/Libraries/crt0.o_src/Makefile | 4 +++- Usermode/Libraries/libc.so_src/Makefile | 6 ------ 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48c449cb..d39dc5d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ -#language: c -#compiler: clang +language: c +compiler: clang #before_install: # - sudo apt-get update -qq # - sudo apt-get install -qq nasm #env: # - ARCH=host HOST_ARCH=x86 USE_ACPICA=0 # - ARCH=host HOST_ARCH=x86_64 CC="$CC -m64" -#script: "make all" +script: "make utest mtest" diff --git a/Makefile b/Makefile index 468efd23..8409f6ec 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ AI_USRAPPS := $(addprefix allinstall-,$(USRAPPS)) .PHONY: all clean install \ kmode all-kmode clean-kmode \ all-user clean-user \ + utest mtest \ $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS) \ $(AI_MODULES) allinstall-Kernel $(AI_USRLIBS) $(AI_USRAPPS) \ $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) \ @@ -56,6 +57,15 @@ all-install: install-Filesystem SyscallList $(AI_USRLIBS) $(AI_USRAPPS) $(AI_MOD clean: $(CLEAN_DYNMODS) $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) install: install-Filesystem SyscallList $(INSTALL_USRLIBS) $(INSTALL_USRAPPS) $(INSTALL_DYNMODS) $(INSTALL_MODULES) install-Kernel +utest: $(USRLIBS:%=utest-%) + +$(USRLIBS:%=utest-%): utest-%: + @$(SUBMAKE) -C Usermode/Libraries/$*_src generate_exp + @$(SUBMAKE) -C Usermode/Libraries/$*_src utest -k + +mtest: + ; + SyscallList: include/syscalls.h include/syscalls.h: KernelLand/Kernel/Makefile KernelLand/Kernel/syscalls.lst @make -C KernelLand/Kernel/ include/syscalls.h diff --git a/Usermode/Libraries/Makefile.tpl b/Usermode/Libraries/Makefile.tpl index d25d5aa5..21f805cb 100644 --- a/Usermode/Libraries/Makefile.tpl +++ b/Usermode/Libraries/Makefile.tpl @@ -23,6 +23,8 @@ all: $(_BIN) $(_XBIN) utest: utest-build utest-run +generate_exp: $(UTESTS:%=EXP_%.txt) + utest-build: $(UTESTS:%=TEST_%) utest-run: $(UTESTS:%=runtest-%) diff --git a/Usermode/Libraries/acess.ld_src/Makefile b/Usermode/Libraries/acess.ld_src/Makefile index 157f02d9..4b66433c 100644 --- a/Usermode/Libraries/acess.ld_src/Makefile +++ b/Usermode/Libraries/acess.ld_src/Makefile @@ -8,7 +8,7 @@ BIN = $(OUTPUTDIR)Libs/acess.ld -.PHONY: all clean install +.PHONY: all clean install utest generate_exp all: $(BIN) @@ -17,6 +17,8 @@ clean: install: $(BIN) +utest generate_exp: + $(BIN): acess_$(ARCHDIR).ld.h @mkdir -p $(dir $(BIN)) cpp -nostdinc -U i386 -P -C $< -o $@ -D__LIBDIR=$(OUTPUTDIR)Libs diff --git a/Usermode/Libraries/crt0.o_src/Makefile b/Usermode/Libraries/crt0.o_src/Makefile index 55ae732c..509eea4d 100644 --- a/Usermode/Libraries/crt0.o_src/Makefile +++ b/Usermode/Libraries/crt0.o_src/Makefile @@ -6,7 +6,7 @@ BIN = $(OUTPUTDIR)Libs/crt0.o $(OUTPUTDIR)Libs/crtbegin.o $(OUTPUTDIR)Libs/crtend.o -.PHONY: all clean install +.PHONY: all clean install utest generate_exp all: $(BIN) @@ -15,6 +15,8 @@ install: $(BIN) clean: $(RM) $(BIN) +utest generate_exp: + $(OUTPUTDIR)Libs/%.o: %.c @mkdir -p $(dir $@) $(CC) -c $< -o $@ diff --git a/Usermode/Libraries/libc.so_src/Makefile b/Usermode/Libraries/libc.so_src/Makefile index bcc369c6..2e4e2b2c 100644 --- a/Usermode/Libraries/libc.so_src/Makefile +++ b/Usermode/Libraries/libc.so_src/Makefile @@ -20,12 +20,6 @@ BIN = libc.so include ../Makefile.tpl -.PHONY: generate_exp - -utest-run: generate_exp - -generate_exp: EXP_printf.txt - EXP_%.txt: TEST_%.native ./TEST_printf.native > EXP_printf.txt rm TEST_printf.native -- 2.20.1