Changes in / [105d8d6:15d0046] in mainline


Ignore:
Files:
60 added
8 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r105d8d6 r15d0046  
    600600! CONFIG_WRITE_CORE_FILES (n/y)
    601601
     602% Build userspace unit tests (PCUT)
     603! CONFIG_PCUT_TESTS (n/y)
     604
    602605% Include development files (headers, libraries)
    603606! CONFIG_DEVEL_FILES (n/y)
  • boot/Makefile

    r105d8d6 r15d0046  
    6868                cp "$$file" "$(DIST_PATH)/app/" ; \
    6969        done
     70ifeq ($(CONFIG_PCUT_TESTS),y)
     71        echo "echo Running all tests..." >"$(DIST_PATH)/test/run_all"
     72        echo "<html><head><title>HelenOS test results</title></head><body>" >"$(DIST_PATH)/test/test.html"
     73        echo "<h1>HelenOS test results</h1><ul>" >>"$(DIST_PATH)/test/test.html"
     74        for file in $(RD_TESTS) ; do \
     75                file2=`basename $$file`; \
     76                cp "$$file" "$(DIST_PATH)/test/" ; \
     77                echo "echo ' ->' $$file2" >>"$(DIST_PATH)/test/run_all"; \
     78                echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \
     79                echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \
     80                echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_all"; \
     81                echo "<li><a href=\"result-$$file2.txt\">$$file2</a></li>" >>"$(DIST_PATH)/test/test.html"; \
     82        done
     83        echo "cp -f /test/test.html /data/web/test.html" >>"$(DIST_PATH)/test/run_all"
     84        echo "</ul></body></html>" >>"$(DIST_PATH)/test/test.html"
     85endif
     86
    7087        for drv in $(RD_DRVS) ; do \
    7188                drv_dir="`dirname "$$drv"`" ; \
     
    100117        rm -rf $(USPACE_PATH)/dist/inc/*
    101118        rm -f $(USPACE_PATH)/dist/app/*
     119        rm -f $(USPACE_PATH)/dist/test/*
    102120        rm -f $(USPACE_PATH)/dist/cfg/net/*
  • boot/Makefile.common

    r105d8d6 r15d0046  
    221221        $(USPACE_PATH)/app/fontviewer/fontviewer
    222222
     223RD_TESTS = \
     224        $(USPACE_PATH)/lib/c/test-libc \
     225        $(USPACE_PATH)/lib/posix/test-libposix \
     226        $(USPACE_PATH)/app/bdsh/test-bdsh
     227
     228
    223229COMPONENTS = \
    224230        $(KERNEL_PATH)/kernel.bin \
  • uspace/Makefile

    r105d8d6 r15d0046  
    236236        lib/gpt
    237237
     238ifeq ($(CONFIG_PCUT_TESTS),y)
     239        LIBS += lib/pcut
     240endif
     241
    238242LIBC_BUILD = $(addsuffix .build,$(LIBC))
    239243LIBS_BUILD = $(addsuffix .build,$(LIBS))
    240244LIBN_BUILD = $(addsuffix .build,$(LIBN))
    241245BUILDS := $(addsuffix .build,$(DIRS))
     246BUILDS_TESTS := $(addsuffix .build-test,$(DIRS) $(LIBS) lib/c)
    242247
    243248CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(LIBN)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC))
     
    245250.PHONY: all $(LIBC_BUILD) $(LIBS_BUILD) $(LIBN_BUILD) $(BUILDS) $(CLEANS) clean
    246251
    247 all: $(BUILDS)
     252all: $(BUILDS) $(BUILDS_TESTS)
     253
     254$(BUILDS_TESTS): $(BUILDS)
     255        $(MAKE) -C $(basename $@) all-test PRECHECK=$(PRECHECK)
    248256
    249257clean: $(CLEANS)
  • uspace/Makefile.common

    r105d8d6 r15d0046  
    7878        JOB = $(BINARY).job
    7979        OUTPUT = $(BINARY)
     80        TEST_BINARY = test-$(BINARY)
    8081        EXTRA_OUTPUT += $(BINARY).disasm
    8182        EXTRA_CLEAN += $(BINARY).map
     
    8586        JOB = $(LIBRARY).job
    8687        OUTPUT = $(LIBRARY).a
     88        TEST_BINARY = test-$(LIBRARY)
    8789endif
    8890
     
    200202endif
    201203
     204# PCUT-based unit tests
     205ifeq ($(CONFIG_PCUT_TESTS),y)
     206ifneq ($(TEST_SOURCES),)
     207        TEST_OUTPUT = $(TEST_BINARY)
     208        TEST_CFLAGS = -I$(LIB_PREFIX)/pcut/include -D__helenos__
     209        TEST_OUTPUT_LIBS = $(LIB_PREFIX)/pcut/libpcut.a
     210        EXTRA_CLEAN += $(TEST_OUTPUT) $(TEST_OUTPUT).map
     211ifneq ($(LIBRARY),)
     212        TEST_OUTPUT_LIBS += $(OUTPUT)
     213endif
     214        TEST_OUTPUT_LIBS += $(TEST_LIBS)
     215endif
     216endif
     217
    202218.PHONY: all clean
    203219
    204220all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(LOUTPUT) $(EXTRA_OUTPUT)
    205221        -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV)
     222
     223all-test: $(TEST_OUTPUT)
    206224
    207225clean:
     
    294312OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
    295313LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES)))
     314TEST_OBJECTS := $(addsuffix .test.o,$(basename $(TEST_SOURCES)))
    296315
    297316ifneq ($(BINARY),)
     
    338357endif
    339358
     359ifeq ($(CONFIG_PCUT_TESTS),y)
     360ifneq ($(TEST_OUTPUT),)
     361$(TEST_OUTPUT): $(LINKER_SCRIPT) $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS)
     362        $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(TEST_OUTPUT).map -o $@ $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) $(LIBS) $(BASE_LIBS)
     363ifeq ($(CONFIG_STRIP_BINARIES),y)
     364        $(STRIP) $(TEST_OUTPUT)
     365endif
     366endif
     367endif
     368
    340369%.o: %.S $(DEPEND)
    341370        $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
     
    356385endif
    357386
     387%.test.o: %.c $(DEPEND)
     388        $(CC) $(DEFS) $(CFLAGS) $(TEST_CFLAGS) -c $< -o $@
     389ifeq ($(PRECHECK),y)
     390        $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
     391endif
     392
    358393%.lo: %.S $(DEPEND)
    359394        $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@
     
    375410
    376411$(DEPEND): $(PRE_DEPEND)
    377         makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null
     412        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) $(TEST_SOURCES) > $@ 2> /dev/null
    378413        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
    379414
  • uspace/app/bdsh/Makefile

    r105d8d6 r15d0046  
    6565        tok.c
    6666
     67TEST_SOURCES = \
     68        tok.c \
     69        test/toktest.c
     70
    6771include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/c/Makefile

    r105d8d6 r15d0046  
    165165        $(ARCH_SOURCES)
    166166
     167TEST_SOURCES = \
     168        test/main.c \
     169        test/sprintf.c
     170
    167171include $(USPACE_PREFIX)/Makefile.common
    168172
  • uspace/lib/posix/Makefile

    r105d8d6 r15d0046  
    7979        source/unistd.c
    8080
     81TEST_SOURCES = \
     82        test/main.c \
     83        test/scanf.c
     84
    8185include $(USPACE_PREFIX)/Makefile.common
    8286
Note: See TracChangeset for help on using the changeset viewer.