Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ endif
include ../src/osmodel.mak

export OS
BUILD=release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? debug is a better choice for testing in general and tests for specific optimization arguments, such as -release, do so via PERMUTE_ARGS. This variable affects only the test runner, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Because you need to find the DMD binary somehow and as Makefile variable at least the user can overwrite it...

debug is a better choice for testing in general and tests for specific optimization arguments

Hehe debug is simply a different folder as of now:
#6898

This variable affects only the test runner, right?

Yes.

Copy link
Member

@PetarKirov PetarKirov Jul 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because you need to find the DMD binary somehow and as Makefile variable at least the user can overwrite it...

I mean, is there a reason for preferring release over debug? If not I think it would be better to stick with debug, even though currently there may not be much of a difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, is there a reason for preferring release over debug?

Hehe I agree, but release is the default and thus used by auto-tester.


ifeq (freebsd,$(OS))
SHELL=/usr/local/bin/bash
Expand All @@ -100,7 +101,6 @@ export REQUIRED_ARGS=

ifeq ($(findstring win,$(OS)),win)
export ARGS=-inline -release -g -O
export DMD=../src/dmd.exe
export EXE=.exe
export OBJ=.obj
export DSEP=\\
Expand All @@ -110,21 +110,40 @@ DRUNTIME_PATH=..\..\druntime
PHOBOS_PATH=..\..\phobos
export DFLAGS=-I$(DRUNTIME_PATH)\import -I$(PHOBOS_PATH)
export LIB=$(PHOBOS_PATH)

# auto-tester might run the testsuite with a different $(MODEL) than DMD
# has been compiled with. Hence we manually check which binary exists.
# For windows the $(OS) during build is: `windows`
ifeq (,$(wildcard ../generated/windows/$(BUILD)/64/dmd$(EXE)))
DMD_MODEL=32
else
DMD_MODEL=64
endif
export DMD=../generated/windows/$(BUILD)/$(DMD_MODEL)/dmd$(EXE)

else
export ARGS=-inline -release -g -O -fPIC
export DMD=../src/dmd
export EXE=
export OBJ=.o
export DSEP=/
export SEP=/

# auto-tester might run the testsuite with a different $(MODEL) than DMD
# has been compiled with. Hence we manually check which binary exists.
ifeq (,$(wildcard ../generated/$(OS)/$(BUILD)/64/dmd))
DMD_MODEL=32
else
DMD_MODEL=64
endif
export DMD=../generated/$(OS)/$(BUILD)/$(DMD_MODEL)/dmd

DRUNTIME_PATH=../../druntime
PHOBOS_PATH=../../phobos
# link against shared libraries (defaults to true on supported platforms, can be overridden w/ make SHARED=0)
SHARED=$(if $(findstring $(OS),linux freebsd),1,)
DFLAGS=-I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL)
DFLAGS=-I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Druntime and Phobos are built with the opposite MODEL on auto-tester
For example for 32_64: builds 32-bit DMD, but 64-but DRuntime + Phobos

ifeq (1,$(SHARED))
DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL)
DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)
endif
export DFLAGS
endif
Expand Down