source: tags/ms_r16q2/UNIT_TESTER/Makefile.suite

Last change on this file was 14799, checked in by westram, 8 years ago
  • make 4.1 spams the compile log with
    recipe for target 'xxx' failed
    
    • replaces -oktofail by oktofail || true
File size: 2.9 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_LOG_DIR = ./logs
12TEST_FLAG_DIR = ./flags
13
14JUNIT_LOG = $(TEST_LOG_DIR)/junit_log.xml# see also reporter.pl@JUNITLOGNAME
15
16PATCHNAMEBASE:=TestsOk
17PATCHNAMESUFFIX:=
18
19VALGRIND_INTERNAL=$(findstring B,$(VALGRIND))$(findstring A,$(VALGRIND))
20VALGRIND_EXTERNAL=$(findstring E,$(VALGRIND))
21VALGRIND_ANY=$(VALGRIND_INTERNAL)$(VALGRIND_EXTERNAL)
22
23# -------------------- build patch name
24
25ifneq ('$(RESTRICT_LIB)','')
26PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__only_$(RESTRICT_LIB)
27endif
28
29ifneq ($(RESTRICT_MODULE),'.')
30PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__notAllFiles
31endif
32
33SKIPPED_SLOW:=$(shell (test -f skipslow.stamp && ls -1 skipslow.stamp))
34ifneq ('$(SKIPPED_SLOW)','')
35PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__SLOW_skipped
36endif
37
38ifneq ('$(VALGRIND_ANY)','')
39PATCHNAMESUFFIX:=$(PATCHNAMESUFFIX)__valgrinded_$(VALGRIND_ANY)
40endif
41
42PATCHNAMESUFFIX:=$(subst :,_,$(PATCHNAMESUFFIX))
43
44# -------------------- targets
45
46failed_to_clean:
47        @echo "$(TEST_BASE)/Makefile.suite:45: Error: Failed to clean environment"
48        @echo "If there are any changing|failed*.flag files listed here:"
49        @ls -al $(TEST_FLAG_DIR)/changing*.flag $(TEST_FLAG_DIR)/failed*.flag
50        @echo "then some test_environment failed to setup or cleanup properly!"
51        @echo "[Note: removing flag-files now to avoid failure of next test-run]"
52        rm $(TEST_FLAG_DIR)/changing*.flag $(TEST_FLAG_DIR)/failed*.flag
53        @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"
54        @grep -Pin 'arb-backtrace|segv' $(TEST_BASE)/$(TEST_LOG_DIR)/*.log | grep -v 'GBK_install_SIGSEGV_handler'
55# do NOT fail here, otherwise reporter will get no chance to list failure-reason
56
57cleanup_environment:
58        ((./test_environment clean 2>&1) | $(ARBHOME)/SOURCE_TOOLS/asan2msg.pl) || $(MAKE) -f Makefile.suite failed_to_clean
59ifneq ($(SANITIZE),0)
60# delay until servers were able to append to log (before reporter scans logs)
61# cannot be ensured as they run asynchronous
62        sleep 1
63endif
64ifeq ($(VALGRIND_EXTERNAL),E)
65        ./valgrind/arb_valgrind_logged WAIT
66endif
67
68tests_passed: cleanup_environment
69        @$(TEST_REPORTER) report $(TEST_LOG_DIR) $(SKIP_SLOW)
70
71update_patches_if_passed: tests_passed
72        @../SOURCE_TOOLS/arb_create_patch.sh $(PATCHNAMEBASE)$(PATCHNAMESUFFIX)
73        @../SOURCE_TOOLS/arb_cleanup_patches.pl $(PATCHNAMEBASE) $(PATCHES_KEEP_HOURS) $(PATCHES_MIN_KEPT)
74
75unskip:
76        @(test -f skipslow.stamp && rm skipslow.stamp) || true
77
78init:
79        @echo "$(SEP) Running unit tests"
80        @rm $(JUNIT_LOG) || true
81#ifeq ($(VALGRIND_EXTERNAL),E)
82        ./valgrind/arb_valgrind_logged INIT "$(VALGRIND_EXTERNAL)" $(CHECK_LEAKS)
83#endif
84        (export CHECK_RESTRICT=$(RESTRICT_LIB); $(TEST_REPORTER) init $(TEST_LOG_DIR) $(SKIP_SLOW))
85
86cleanup: update_patches_if_passed
87        ls -al $(JUNIT_LOG)
88        @echo "$(SEP) All unit tests passed"
89
Note: See TracBrowser for help on using the repository browser.