Usermode - Unit tests called from root makefile
authorJohn Hodge <[email protected]>
Thu, 14 Feb 2013 03:17:03 +0000 (11:17 +0800)
committerJohn Hodge <[email protected]>
Thu, 14 Feb 2013 03:17:03 +0000 (11:17 +0800)
.travis.yml
Makefile
Usermode/Libraries/Makefile.tpl
Usermode/Libraries/acess.ld_src/Makefile
Usermode/Libraries/crt0.o_src/Makefile
Usermode/Libraries/libc.so_src/Makefile

index 48c449c..d39dc5d 100644 (file)
@@ -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"
index 468efd2..8409f6e 100644 (file)
--- 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
index d25d5aa..21f805c 100644 (file)
@@ -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-%)
index 157f02d..4b66433 100644 (file)
@@ -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
index 55ae732..509eea4 100644 (file)
@@ -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 $@
index bcc369c..2e4e2b2 100644 (file)
@@ -20,12 +20,6 @@ BIN = libc.so
 \r
 include ../Makefile.tpl\r
 \r
-.PHONY: generate_exp\r
-\r
-utest-run: generate_exp\r
-\r
-generate_exp: EXP_printf.txt\r
-\r
 EXP_%.txt: TEST_%.native\r
        ./TEST_printf.native > EXP_printf.txt\r
        rm TEST_printf.native\r

UCC git Repository :: git.ucc.asn.au