Show
Ignore:
Timestamp:
09/09/10 22:40:57 (21 months ago)
Author:
westram
Message:
  • unit-test improvements (merged [6757] [6758] [6759] [6760] [6761] [6762] [6764] [6791] [6795] [6798] [6799] [6800] [6801] [6802] [6809] [6810])
    • moved file compare to test_unit.h
    • fake report for skipped tests
    • added templates for char compare
    • perform minihexdump
    • flush output
    • added
      • TEST_ASSERT_FILES_EQUAL__BROKEN
      • TEST_ASSERT_ZERO_OR_SHOW_ERRNO
    • create a fake.patch if there are no changes
    • all code affecting assertions in UNIT_TESTS-mode went to test_global.h
      • overwrites arb_assert()
    • undefine UNIT_TESTS for GDE submakefiles (foreign code there)
    • arb_test::FlushedOutput::errorf raises assertion itself
    • test against I/O errors
    • moved test code
    • refactored message printing
    • unit-tester switches to run directory itself
      • eliminates path hack for valgrind
    • control leak-check by variable
    • added global test-environment (does nothing yet)
Location:
trunk/UNIT_TESTER
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/UNIT_TESTER

    • Property svn:ignore
      •  

        old new  
        55*.gcno 
        66logs 
         7test_environment 
  • trunk/UNIT_TESTER/Makefile.test

    r6812 r6816  
    1515# ---------------------------------------------------------- 
    1616 
     17# @@@ valgrind makes tests fail atm 
     18# (most likely two pt-servers try to start parallel on the same port) 
     19 
    1720VALGRIND=0# only test 
    1821#VALGRIND=1# run valgrind after sucessful test 
    1922#VALGRIND=2# run valgrind before test (useful if test traps w/o any helpful information) 
     23 
     24#CHECK_LEAKS=0# check no leaks 
     25CHECK_LEAKS=1# check definite leaks 
     26#CHECK_LEAKS=2# check reachable leaks 
    2027 
    2128# ---------------------------------------------------------- 
     
    2936# 
    3037RESTRICT_LIB=# run all tests 
     38#RESTRICT_LIB=AWTC# test only this library 
    3139#RESTRICT_LIB=mkptypes# test only these libraries 
    3240#RESTRICT_LIB=client:arb_probe:AWTC# test only these libraries 
     
    8189 
    8290DESTDIR=tests 
    83 RUNDIR=run 
    84 RUN2HERE=..# prefix from RUNDIR to here (UNIT_TESTER) 
     91RUNDIR=run# see also UnitTester.cxx@chdir 
    8592 
    8693SYMLIST=$(DESTDIR)/$(UNIQUE_NAME).sym 
     
    152159        @echo "LINKDEPS       ='$(LINKDEPS)'" 
    153160 
     161ifeq ($(CHECK_LEAKS),0) 
     162        LEAKS:= 
     163else 
     164ifeq ($(CHECK_LEAKS),1) 
     165        LEAKS:=-l 
     166else 
     167        LEAKS:=-l -r 
     168endif 
     169endif 
     170 
    154171valgrind: 
    155172        echo "Valgrinding.." 
    156         cd $(RUNDIR);$(ARBHOME)/SOURCE_TOOLS/arb_valgrind -q -l -r -c 15 $(RUN2HERE)/$(TEST_EXE) 
     173        $(ARBHOME)/SOURCE_TOOLS/arb_valgrind -q $(LEAKS) -c 15 $(TEST_EXE) 
    157174 
    158175perform_test: $(TEST_EXE) 
     
    161178        $(MAKE) -f Makefile.test valgrind 
    162179endif 
    163         cd $(RUNDIR);$(RUN2HERE)/$(TEST_EXE) 
     180        $(TEST_EXE)  
    164181ifeq ($(COVERAGE),1) 
    165182        @echo "-------------------- test-coverage for $(UNITLIBNAME)" 
     
    173190 
    174191skip_test: 
    175         @echo "unit-tests completely skipped for '$(UNITLIBNAME)'" 
     192        @echo "UnitTester: $(UNITLIBNAME) tests=0 (skipped via RESTRICT_LIB)" 
    176193 
    177194# --------------------