Skip to content

Commit 32f1a3f

Browse files
mmghannamsvigerske
authored andcommitted
tests/Makefile: remove disabling ASLR when not on Linux
1 parent 13eb65d commit 32f1a3f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: tests/Makefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,16 @@ ifeq ($(VERBOSE),false)
169169
.SILENT: $(UNITTESTSBIN) $(UNITTESTSOBJ)
170170
endif
171171

172+
# Disable ASLR (address space layout randomization) on Linux via setarch -R
173+
# as this is not compatible with Criterions parametrized tests (https://github.com/Snaipe/Criterion/issues/208)
174+
ifeq ($(OSTYPE),linux)
175+
DISABLE_ASLR := setarch `uname -m` -R
176+
endif
172177

173178
.PHONY: all
174179
all: Criterion $(OBJDIR) $(OBJDIRS) $(BINDIRS) $(UNITTESTSBIN)
175180
make ctestrunner
176-
setarch `uname -m` -R ctest --output-on-failure $(if $(FILTER), -R $(FILTER))
181+
$(DISABLE_ASLR) ctest --output-on-failure $(if $(FILTER), -R $(FILTER))
177182

178183
.PHONY: lint
179184
lint: $(UNITTESTSSRC)
@@ -195,12 +200,10 @@ $(BINDIRS):
195200
@echo "-> Creating $@ directory"
196201
@-mkdir -p $@
197202

198-
# run the tests with address space layout randomization disabled, as this isn't
199-
# compatible with Criterions parametrized tests (https://github.com/Snaipe/Criterion/issues/208)
200203
.PHONY: test
201204
test: $(UNITTESTSBIN)
202205
make ctestrunner
203-
setarch `uname -m` -R ctest --output-on-failure $(if $(FILTER), -R $(FILTER))
206+
$(DISABLE_ASLR) --output-on-failure $(if $(FILTER), -R $(FILTER))
204207

205208
.PHONY: ctestrunner
206209
ctestrunner: $(UNITTESTSBIN)

0 commit comments

Comments
 (0)