source: trunk/UNIT_TESTER/Makefile.suite

Last change on this file was 19613, checked in by westram, 3 weeks ago
  • reintegrates 'lib' into 'trunk'
    • replace dynamic library AWT by several static libraries: APP, ARB_SPEC, MASKS, CANVAS, MAPKEY, GUI_TK
    • now also check wrong library dependencies for untested units (only4me)
  • adds: log:branches/lib@19578:19612
File size: 3.7 KB
Line 
1
2notarget:
3        @echo "Usage: make (init|cleanup|unskip)"
4        false
5
6include Makefile.setup.include
7
8TEST_BASE=`pwd`
9
10TEST_REPORTER = ./reporter.pl
11TEST_DUPSYMWARN = ./dupsymwarn.pl
12TEST_LOG_DIR = ./logs
13TEST_FLAG_DIR = ./flags
14
15JUNIT_LOG = $(TEST_LOG_DIR)/junit_log.xml# see also reporter.pl@JUNITLOGNAME
16
17PATCHNAMEBASE:=TestsOk
18PATCHNAMESUFFIX:=
19
20VALGRIND_INTERNAL=$(findstring B,$(VALGRIND))$(findstring A,$(VALGRIND))
21VALGRIND_EXTERNAL=$(findstring E,$(VALGRIND))
22VALGRIND_ANY=$(VALGRIND_INTERNAL)$(VALGRIND_EXTERNAL)
23
24# -------------------- build patch name
25
26ifneq ('$(RESTRICT_LIB)','')
27PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__only_$(RESTRICT_LIB)
28endif
29
30ifneq ($(RESTRICT_MODULE),'.')
31PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__notAllFiles
32endif
33
34SKIPPED_SLOW:=$(shell (test -f skipslow.stamp && ls -1 skipslow.stamp))
35ifneq ('$(SKIPPED_SLOW)','')
36        PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__SLOW_skipped
37        SYMDIR=./tests
38else
39        SYMDIR=./tests.slow
40endif
41
42ifneq ('$(VALGRIND_ANY)','')
43PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__valgrinded_$(VALGRIND_ANY)
44endif
45
46PATCHNAMESUFFIX:=$(subst :,_,$(PATCHNAMESUFFIX))
47
48# -------------------- targets
49
50failed_to_clean:
51        @echo "$(TEST_BASE)/Makefile.suite:45: Error: Failed to clean environment"
52        @echo "If there are any changing|failed*.flag files listed here:"
53        @ls -al $(TEST_FLAG_DIR)/changing*.flag $(TEST_FLAG_DIR)/failed*.flag
54        @echo "then some test_environment failed to setup or cleanup properly!"
55        @echo "[Note: removing flag-files now to avoid failure of next test-run]"
56        rm $(TEST_FLAG_DIR)/changing*.flag $(TEST_FLAG_DIR)/failed*.flag
57        @echo "$(TEST_BASE)/$(TEST_LOG_DIR):0: Hint: if no error is reported further below, you may also find the cause in these log-files"
58        @grep -in 'arb-backtrace\|segv' $(TEST_BASE)/$(TEST_LOG_DIR)/*.log | grep -v 'GBK_install_SIGSEGV_handler'
59# do NOT fail here, otherwise reporter will get no chance to list failure-reason
60
61cleanup_environment:
62        ((./test_environment clean 2>&1) | $(ARBHOME)/SOURCE_TOOLS/asan2msg.pl) || $(MAKE) -f Makefile.suite failed_to_clean
63ifneq ($(SANITIZE),0)
64# delay until servers were able to append to log (before reporter scans logs)
65# cannot be ensured as they run asynchronous
66        sleep 1
67endif
68ifeq ($(VALGRIND_EXTERNAL),E)
69        ./valgrind/arb_valgrind_logged WAIT
70endif
71
72tests_passed: cleanup_environment
73        @( \
74                export WARN_LEVEL=$(WARN_LEVEL); \
75                $(TEST_REPORTER) report $(TEST_LOG_DIR) $(SKIP_SLOW); \
76        )
77
78update_patches_if_passed: tests_passed
79        @../SOURCE_TOOLS/arb_create_patch.sh $(PATCHNAMEBASE)$(PATCHNAMESUFFIX)
80        @../SOURCE_TOOLS/arb_cleanup_patches.pl $(PATCHNAMEBASE) $(PATCHES_KEEP_HOURS) $(PATCHES_MIN_KEPT)
81
82unskip:
83        @(test -f skipslow.stamp && rm skipslow.stamp) || true
84
85DUPSYMLIST=$(SYMDIR)/dupsym.lst
86SYMFILES=$(wildcard $(SYMDIR)/*.sym)
87
88$(DUPSYMLIST): $(SYMFILES) $(TEST_DUPSYMWARN)
89ifeq ($(DARWIN),1)
90# under OSX output of nm lacks symbol-type-flag => no way to test for duplicate symbols.
91        @echo "Note: Skipped test for duplicated symbols under OSX (nm-output insufficient)"
92else
93 ifeq ($(SYMFILES),)
94        @echo "Note: Skipped test for duplicated symbols (no .sym files seen)"
95 else
96        @$(TEST_DUPSYMWARN) $(SYMFILES) > $(DUPSYMLIST) || (rm $(DUPSYMLIST) && false)
97 endif
98endif
99
100list_duplicate_shared_symbols: $(DUPSYMLIST)
101        @-(test -f $(DUPSYMLIST) && cat $(DUPSYMLIST))
102
103init:
104        @echo "$(SEP) Running unit tests"
105        @rm $(JUNIT_LOG) || true
106#ifeq ($(VALGRIND_EXTERNAL),E)
107        @./valgrind/arb_valgrind_logged INIT "$(VALGRIND_EXTERNAL)" $(CHECK_LEAKS)
108#endif
109        @( \
110                export CHECK_RESTRICT=$(RESTRICT_LIB); \
111                export WARN_LEVEL=$(WARN_LEVEL); \
112                $(TEST_REPORTER) init $(TEST_LOG_DIR) $(SKIP_SLOW); \
113        )
114
115# 'cleanup' is called after all tests finished:
116cleanup: update_patches_if_passed list_duplicate_shared_symbols
117        ls -al $(JUNIT_LOG)
118        @echo "$(SEP) All unit tests passed"
119
Note: See TracBrowser for help on using the repository browser.