Skip to content

Commit

Permalink
Build dub from source on the auto-tester
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Aug 15, 2018
1 parent b42e88f commit fda5cba
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ build-html:
################################################################################

${TOOLS_DIR}:
git clone --depth=1 ${GIT_HOME}/$(@F) $@
[ -d $@ ] || git clone --depth=1 ${GIT_HOME}/$(@F) $@

$(TOOLS_DIR)/checkwhitespace.d: | $(TOOLS_DIR)
$(TOOLS_DIR)/tests_extractor.d: | $(TOOLS_DIR)
Expand Down Expand Up @@ -601,13 +601,27 @@ style_lint: dscanner $(LIB)
@echo "Check that Ddoc runs without errors"
$(DMD) $(DFLAGS) $(NODEFAULTLIB) $(LIB) -w -D -Df/dev/null -main -c -o- $$(find etc std -type f -name '*.d') 2>&1

################################################################################
# Build dub from source if no dub is available
################################################################################

DUB_PATH=$(abspath $(shell which $(DUB)))
ifeq (,$(DUB_PATH))
DUB_PATH=$(ROOT)/dub/bin/dub
DUB=$(DUB_PATH)
endif

$(DUB): | $(LIB)
[ -d $(ROOT)/dub ] || git clone --depth=1 ${GIT_HOME}/dub $(ROOT)/dub
cd $(ROOT)/dub && DFLAGS="$(DFLAGS) $(LIB) $(NODEFAULTLIB) $(LINKDL)" DMD=$(shell pwd)/$(DMD) ./build.sh

################################################################################
# Build the test extractor.
# - extracts and runs public unittest examples to checks for missing imports
# - extracts and runs @betterC unittests
################################################################################

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

Expand Down Expand Up @@ -661,6 +675,7 @@ betterc-run-tests: $(subst .d,.run,$(wildcard test/betterC/*.d))
auto-tester-build: all checkwhitespace

.PHONY : auto-tester-test
auto-tester-test: unittest betterc
auto-tester-test: unittest
$(MAKE) -f posix.mak betterc

.DELETE_ON_ERROR: # GNU Make directive (delete output files on error)

0 comments on commit fda5cba

Please sign in to comment.