-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.more
More file actions
86 lines (59 loc) · 2.59 KB
/
Makefile.more
File metadata and controls
86 lines (59 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright © 2025–2026 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
# Matthias Kretz <m.kretz@gsi.de>
include Makefile.common
shuffled_checks = $(shell shuf $(check_targets))
untested = $(filter-out $(wildcard check/*.*/*.*),$(shuffled_checks))
totaltests := $(shell echo $$(( $(words $(testarchs)) \
* $(words $(foreach t,$(tests),$(foreach y,$(call testtypes_for_test,$(t)),x))) \
* $(words $(testwidths)) )))
total1 := $(shell echo $$(( ($(totaltests) + 50) / 100)))
total10 := $(shell echo $$(( ($(totaltests) + 5) / 10)))
debug:
@echo "#untested: $(words $(untested))"
@echo total1: $(total1)
@echo total10: $(total10)
ifneq ($(MAKE_TERMOUT),)
setup_progress: clean-outdated
$(eval export init_progress := $(words $(foreach t,$(tests),$(foreach a,$(testarchs),$(wildcard check/$t.$a/*.*)))))
$(eval export start_time := $(shell date +%s))
$(file > $(objdir)/.progress,$(init_progress))
print_progress := flock $(objdir)/.progress ./increment.sh $(objdir)/.progress | \
{ read p && \
remain=$$(($(totaltests)-p)) && \
rate=$$((60 * (p - $$init_progress) / ($$(date +%s) - $$start_time))) && \
done=$$(((1000 * p / $(totaltests)))) && \
timeremain=$$((remain/rate)) && \
printf "[%2d.%d%% %2d%%/day %dh%02d remain]" \
$$((done / 10)) $$((done % 10)) \
$$((144000 * rate / $(totaltests))) \
$$((timeremain / 60)) $$((timeremain % 60)); \
}
endif
.PHONY: check ci check10 check1
check: check-constexpr $(shuffled_checks) $(codegen_targets)
ci: check-constexpr $(wordlist 1,$(shell echo $$((5*$(words $(tests))))),$(shuffled_checks))
check1: check-constexpr $(wordlist 1,$(total1),$(shuffled_checks)) $(codegen_targets)
check10: check-constexpr $(wordlist 1,$(total10),$(shuffled_checks)) $(codegen_targets)
.PHONY: check-failed check-passed check-untested
check_subdirs := $(wildcard check/*.*/)
ifeq ($(check_subdirs),)
check-failed:
check-passed:
else
check-failed: $(patsubst %.failed,%,$(wildcard check/*.*/*.*.failed))
check-passed: $(shell find $(check_subdirs) ! -name '*.failed'|shuf)
endif
check-untested: $(untested)
check-fast-math: $(patsubst check/%,check/fast-math/%,$(shuffled_checks))
rerun/%: $(objdir)/%
@$< >$(@:rerun/%.exe=check/%) 2>&1 && { \
printf -- '$(msg_run) $@\n'; \
touch -r $< $(@:rerun/%.exe=check/%); \
} || { \
printf -- '$(msg_runf) $@\n'; \
cat $(@:rerun/%.exe=check/%); \
mv $(@:rerun/%.exe=check/%) $(@:rerun/%.exe=check/%).failed; \
false; \
}
rerun: $(patsubst $(objdir)/%,rerun/%,$(wildcard $(objdir)/*.*/*.*.exe))