| 1 |
TESTS := profile profilegc both |
| 2 |
# LDC doesn't support -profile=gc yet |
| 3 |
ifdef IN_LDC |
| 4 |
TESTS := $(filter-out profilegc both,$(TESTS)) |
| 5 |
endif |
| 6 |
|
| 7 |
include ../common.mak |
| 8 |
|
| 9 |
|
| 10 |
DIFF:=diff --strip-trailing-cr |
| 11 |
GREP:=grep |
| 12 |
SED:=sed |
| 13 |
|
| 14 |
ifeq (freebsd,$(OS)) |
| 15 |
SHELL=/usr/local/bin/bash |
| 16 |
else ifeq (openbsd,$(OS)) |
| 17 |
SHELL=/usr/local/bin/bash |
| 18 |
else ifeq (netbsd,$(OS)) |
| 19 |
SHELL=/usr/pkg/bin/bash |
| 20 |
else ifeq (dragonflybsd,$(OS)) |
| 21 |
SHELL=/usr/local/bin/bash |
| 22 |
else ifneq (windows,$(OS)) # already using a bash shell on Windows via common.mak |
| 23 |
SHELL=/bin/bash |
| 24 |
endif |
| 25 |
|
| 26 |
$(ROOT)/profile.done: $(ROOT)/%.done: $(ROOT)/%$(DOTEXE) |
| 27 |
@echo Testing $* |
| 28 |
@rm -f $(ROOT)/mytrace.log $(ROOT)/mytrace.def |
| 29 |
$(TIMELIMIT)$(ROOT)/$* $(ROOT)/mytrace.log $(ROOT)/mytrace.def |
| 30 |
$(GREP) -q '1 .*_Dmain' $(ROOT)/mytrace.log |
| 31 |
$(GREP) -q '1000 .*uint profile.foo(uint)' $(ROOT)/mytrace.log |
| 32 |
cat $(ROOT)/mytrace.def |
| 33 |
sort $(ROOT)/mytrace.def -o $(ROOT)/mytrace.def |
| 34 |
(sort mytrace.def.exp | $(DIFF) - $(ROOT)/mytrace.def) || (sort mytrace.releaseopt.def.exp | $(DIFF) - $(ROOT)/mytrace.def) |
| 35 |
@touch $@ |
| 36 |
$(ROOT)/profile$(DOTEXE): extra_dflags += -profile |
| 37 |
|
| 38 |
$(ROOT)/profilegc.done: $(ROOT)/%.done: $(ROOT)/%$(DOTEXE) |
| 39 |
@echo Testing $* |
| 40 |
@rm -f $(ROOT)/myprofilegc.log |
| 41 |
$(TIMELIMIT)$(ROOT)/$* $(ROOT)/myprofilegc.log |
| 42 |
$(DIFF) \ |
| 43 |
<($(GREP) -vF 'core.' myprofilegc.log.$(OS).$(shell echo $(MODEL) | cut -c 1-2).exp) \ |
| 44 |
<($(GREP) -vF 'core.' $(ROOT)/myprofilegc.log) |
| 45 |
@touch $@ |
| 46 |
$(ROOT)/profilegc$(DOTEXE): extra_dflags += -profile=gc |
| 47 |
|
| 48 |
$(ROOT)/both.done: $(ROOT)/%.done: $(ROOT)/%$(DOTEXE) |
| 49 |
@echo Testing $* |
| 50 |
@rm -f $(ROOT)/both.log $(ROOT)/both.def $(ROOT)/bothgc.log |
| 51 |
$(TIMELIMIT)$(ROOT)/$* $(ROOT)/both.log $(ROOT)/both.def $(ROOT)/bothgc.log |
| 52 |
$(GREP) -q '1 .*_Dmain' $(ROOT)/both.log |
| 53 |
$(GREP) -q '1000 .*both.Num\* both.foo(uint)' $(ROOT)/both.log |
| 54 |
cat $(ROOT)/both.def |
| 55 |
sort $(ROOT)/both.def -o $(ROOT)/both.def |
| 56 |
(sort bothnew.def.exp | $(DIFF) - $(ROOT)/both.def) |
| 57 |
ifeq (windows,$(OS)) |
| 58 |
$(DIFF) \ |
| 59 |
<($(GREP) -vF 'core.' bothgc.log.exp) \ |
| 60 |
<($(GREP) -vF 'core.' $(ROOT)/bothgc.log | $(SED) 's: src\\\\: src/:g') |
| 61 |
else |
| 62 |
$(DIFF) \ |
| 63 |
<($(GREP) -vF 'core.' bothgc.log.exp) \ |
| 64 |
<($(GREP) -vF 'core.' $(ROOT)/bothgc.log) |
| 65 |
endif |
| 66 |
@touch $@ |
| 67 |
$(ROOT)/both$(DOTEXE): extra_dflags += -profile -profile=gc |