Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
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
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ jobs:
- run:
command: ./.circleci/run.sh betterc
name: Run @betterC tests
- run:
command: ./.circleci/run.sh publictests
name: Run public unittests
Copy link
Contributor

Choose a reason for hiding this comment

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

Just as an FYI this won't apply to all existing PRs. They need to be rebased for them to have this test.

11 changes: 11 additions & 0 deletions .circleci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ betterc()
make -f posix.mak betterc -j$N DUB="$HOME/dlang/dmd-${HOST_DMD_VER}/linux/bin64/dub"
}

publictests()
{
# checkout a specific version of https://github.com/dlang/tools
if [ ! -d ../tools ] ; then
clone https://github.com/dlang/tools.git ../tools master --depth 1
fi

make -f posix.mak publictests -j$N DUB="$HOME/dlang/dmd-${HOST_DMD_VER}/linux/bin64/dub"
}

codecov()
{
# CodeCov gets confused by lst files which it can't matched
Expand All @@ -122,6 +132,7 @@ case $1 in
setup-repos) setup_repos ;;
style) style ;;
betterc) betterc ;;
publictests) publictests ;;
coverage) coverage ;;
codecov) codecov ;;
esac
18 changes: 18 additions & 0 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,24 @@ style_lint:
@echo "Enforce no whitespace after opening parenthesis"
$(GREP) -nrE "\<(version) \( " $$(find src -name '*.d') ; test $$? -eq 1

################################################################################
# Check for missing imports in public unittest examples.
################################################################################

PUBLICTESTS_DIR=$(ROOT)/publictests
publictests: $(addsuffix .publictests, $(basename $(SRCS)))

################################################################################
# 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 src/core/time.publictests
################################################################################
%.publictests: %.d $(TESTS_EXTRACTOR) $(DRUNTIME) | $(PUBLICTESTS_DIR)/.directory
@$(TESTS_EXTRACTOR) --inputdir $< --outputdir $(PUBLICTESTS_DIR)
@$(DMD) -main $(UDFLAGS) $(UTFLAGS) -defaultlib= -debuglib= -od$(PUBLICTESTS_DIR) $(DRUNTIME) -run $(PUBLICTESTS_DIR)/$(subst /,_,$<)

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

.PHONY : auto-tester-build
ifneq (,$(findstring Darwin_64_32, $(PWD)))
auto-tester-build:
Expand Down
1 change: 0 additions & 1 deletion src/core/demangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,6 @@ char[] mangleFunc(T:FT*, FT)(const(char)[] fqn, char[] dst = null) @safe pure no

private enum hasTypeBackRef = (int function(void**,void**)).mangleof[$-4 .. $] == "QdZi";

///
@safe pure nothrow unittest
{
assert(mangleFunc!(int function(int))("a.b") == "_D1a1bFiZi");
Expand Down
7 changes: 2 additions & 5 deletions src/core/time.d
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,9 @@ unittest
long tl = to!("seconds",long)(t);
assert(tl == 1000);

import core.stdc.math : fabs;
double td = to!("seconds",double)(t);
assert(_abs(td - 1000) < 0.001);
assert(fabs(td - 1000) < 0.001);
}

unittest
Expand Down Expand Up @@ -3703,7 +3704,6 @@ long splitUnitsFromHNSecs(string units)(ref long hnsecs) @safe pure nothrow @nog
return value;
}

///
unittest
{
auto hnsecs = 2595000000007L;
Expand Down Expand Up @@ -3744,7 +3744,6 @@ long getUnitsFromHNSecs(string units)(long hnsecs) @safe pure nothrow @nogc
return convert!("hnsecs", units)(hnsecs);
}

///
unittest
{
auto hnsecs = 2595000000007L;
Expand Down Expand Up @@ -3783,7 +3782,6 @@ long removeUnitsFromHNSecs(string units)(long hnsecs) @safe pure nothrow @nogc
return hnsecs - convert!(units, "hnsecs")(value);
}

///
unittest
{
auto hnsecs = 2595000000007L;
Expand Down Expand Up @@ -3913,7 +3911,6 @@ template nextLargerTimeUnits(string units)
static assert(0, "Broken template constraint");
}

///
unittest
{
assert(nextLargerTimeUnits!"minutes" == "hours");
Expand Down