Skip to content

Commit

Permalink
Let CircleCi check the runnability of public tests on dlang.org
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Dec 16, 2016
1 parent cc7f125 commit 66c57ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test:
override:
- ./circleci.sh style
- ./circleci.sh setup-repos
- ./circleci.sh publictests
- ./circleci.sh coverage:
parallel: true

Expand Down
11 changes: 10 additions & 1 deletion circleci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -uexo pipefail
HOST_DMD_VER=2.068.2 # same as in dmd/src/posix.mak
DSCANNER_DMD_VER=2.071.2 # dscanner needs a more up-to-date version
CURL_USER_AGENT="CirleCI $(curl --version | head -n 1)"
DUB=${DUB:-$HOME/dlang/dub/dub}
N=2

case $CIRCLE_NODE_INDEX in
Expand Down Expand Up @@ -97,9 +98,17 @@ coverage()
make -f posix.mak $(find std etc -name "*.d" | sed "s/[.]d$/.test/" | grep -vE '(std.algorithm.sorting|std.encoding|net.curl)' )
}

# compile all public unittests separately
publictests()
{
clone https://github.com/dlang/tools.git ../tools master
make -f posix.mak publictests DUB=$DUB
}

case $1 in
install-deps) install_deps ;;
coverage) coverage ;;
setup-repos) setup_repos ;;
coverage) coverage ;;
style) style ;;
publictests) publictests ;;
esac
9 changes: 9 additions & 0 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ DRUNTIME_PATH = ../druntime
ZIPFILE = phobos.zip
ROOT_OF_THEM_ALL = generated
ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(BUILD)/$(MODEL)
DUB=dub
# Documentation-related stuff
DOCSRC = ../dlang.org
WEBSITE_DIR = ../web
Expand Down Expand Up @@ -516,6 +517,14 @@ style: ../dscanner/dsc
@echo "Running DScanner"
../dscanner/dsc --config .dscanner.ini --styleCheck $$(find etc std -type f -name '*.d' | grep -vE 'std/traits.d|std/typecons.d') -I.

publictests: $(LIB)
# parse all public unittests from Phobos, for now some modules are excluded
rm -rf out
(cd std && $(DUB) --compiler=$(DMD) ../../tools/phobos_tests_extractor.d --inputdir .. --ignore "allocator/allocator_list.d,allocator/building_blocks/allocator_list.d,allocator/building_blocks/free_list.d,allocator/building_blocks/quantizer,allocator/building_blocks/quantizer,allocator/building_blocks/stats_collector.d,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime.d,digest/hmac.d,digest/sha.d,file.d,index.d,isemail.d,logger/core.d,logger/nulllogger.d,math.d,ndslice/selection.d,ndslice/slice.d,numeric.d,stdio.d,traits.d,typecons.d,uni.d,utf.d,uuid.d" --outputdir ../out)
cd ..
# execute all parsed tests
for file in $$(find out -name '*.d'); do echo "executing $${file}" && $(DMD) $(DFLAGS) -defaultlib= -debuglib= $(LIB) -main -unittest -run $$file || exit 1 ; done

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

Expand Down

0 comments on commit 66c57ad

Please sign in to comment.