Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions .circleci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@ setup_repos() {
}

style() {
make -f posix.mak style
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"

# checkout a specific version of https://github.com/dlang/tools
if [ ! -d ../tools ] ; then
clone https://github.com/dlang/tools.git ../tools master
fi
git -C ../tools checkout 6ad91215253b52e6ecfc39fe1854815867c66f23

make -f posix.mak -j$N style MODEL="$MODEL"
}

coverage() {
Expand All @@ -114,7 +122,7 @@ codecov()
case $1 in
install-deps) install_deps ;;
setup-repos) setup_repos ;;
style) style ;;
style) style;;
coverage) coverage ;;
codecov) codecov ;;
esac
29 changes: 27 additions & 2 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
QUIET:=

DMD_DIR=../dmd
TOOLS_DIR=../tools
DUB=dub

include $(DMD_DIR)/src/osmodel.mak

Expand Down Expand Up @@ -90,7 +92,7 @@ endif
PHOBOS_PATH=../phobos
SHARED=$(if $(findstring $(OS),linux freebsd),1,)
ROOT_DIR := $(shell pwd)
PHOBOS_DFLAGS=-conf= $(MODEL_FLAG) -I$(ROOT_DIR)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL) $(PIC)
PHOBOS_DFLAGS=-conf= $(MODEL_FLAG) -I$(ROOT_DIR)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL) $(PIC) -defaultlib= -debuglib=
ifeq (1,$(SHARED))
PHOBOS_DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)
endif
Expand Down Expand Up @@ -362,12 +364,35 @@ test/%/.clean: test/%/Makefile
# Submission to Druntime are required to conform to the DStyle
# The tests below automate some, but not all parts of the DStyle guidelines.
# See: http://dlang.org/dstyle.html
style: checkwhitespace style_lint
style: style_lint publictests

style_lint:
@echo "Check for trailing whitespace"
$(GREP) -nr '[[:blank:]]$$' $(MANIFEST) ; test $$? -eq 1

################################################################################
# Check for missing imports in public unittest examples.
################################################################################
TESTS_EXTRACTOR=$(ROOT)/tests_extractor
PUBLICTESTS_DIR=$(ROOT)/publictests

publictests: $(addsuffix .publictests, $(basename $(SRCS)))

$(TESTS_EXTRACTOR): $(TOOLS_DIR)/tests_extractor.d | $(LIB)
DFLAGS="$(PHOBOS_DFLAGS)" $(DUB) build --force --compiler=$${PWD}/$(DMD) --single $<
mv $(TOOLS_DIR)/tests_extractor $@

################################################################################
# Extract public tests of a module and test them in an separate file (i.e. without its module)
# This is done to check for potentially missing imports in the examples, e.g.
# make -f posix.mak std/format.publictests
################################################################################
%.publictests: %.d $(TESTS_EXTRACTOR) #| $(PUBLICTESTS_DIR)/.directory
@$(TESTS_EXTRACTOR) --inputdir $< --outputdir $(PUBLICTESTS_DIR)
@$(DMD) $(PHOBOS_DFLAGS) -main $(UDFLAGS) -run $(PUBLICTESTS_DIR)/$(subst /,_,$<)

################################################################################

.PHONY : auto-tester-build
auto-tester-build: target checkwhitespace

Expand Down
1 change: 0 additions & 1 deletion src/core/memory.d
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,6 @@ unittest
// Deleting raw memory
unittest
{
import core.memory : GC;
auto a = GC.malloc(5);
assert(GC.addrOf(cast(void*) a) != null);
__delete(a);
Expand Down
4 changes: 2 additions & 2 deletions src/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -2168,12 +2168,12 @@ auto byKeyValue(T : V[K], K, V)(T aa) pure nothrow @nogc @safe
{
auto p = (() @trusted => cast(substInout!K*) keyp) ();
return *p;
};
}
@property ref value() inout
{
auto p = (() @trusted => cast(substInout!V*) valp) ();
return *p;
};
}
}
return Pair(_aaRangeFrontKey(r),
_aaRangeFrontValue(r));
Expand Down