Skip to content

Commit a2004ee

Browse files
committed
Add assert_writeln_magic unittest to the Makefile test target
1 parent eae2ed4 commit a2004ee

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

posix.mak

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,11 @@ $(ASSERT_WRITELN_BIN): assert_writeln_magic.d $(DUB)
594594
$(DUB) build --single --compiler=$(STABLE_DMD) $<
595595
@mv ./assert_writeln_magic $@
596596

597+
$(ASSERT_WRITELN_BIN)_test: assert_writeln_magic.d $(DUB)
598+
@mkdir -p $(dir $@)
599+
$(DUB) build --single --compiler=$(STABLE_DMD) --build=unittest $<
600+
@mv ./assert_writeln_magic $@
601+
597602
$(PHOBOS_FILES_GENERATED): $(PHOBOS_DIR_GENERATED)/%: $(PHOBOS_DIR)/% $(DUB) $(ASSERT_WRITELN_BIN)
598603
@mkdir -p $(dir $@)
599604
@if [ $(subst .,, $(suffix $@)) == "d" ] && [ "$@" != "$(PHOBOS_DIR_GENERATED)/index.d" ] ; then \
@@ -610,9 +615,12 @@ $(PHOBOS_STABLE_FILES_GENERATED): $(PHOBOS_STABLE_DIR_GENERATED)/%: $(PHOBOS_STA
610615
# Style tests
611616
################################################################################
612617

613-
test:
618+
test: $(ASSERT_WRITELN_BIN)_test
614619
@echo "Searching for trailing whitespace"
615-
if [[ $$(find . -type f -name "*.dd" -exec egrep -l " +$$" {} \;) ]] ; then $$(exit 1); fi
620+
@echo "Check for trailing whitespace"
621+
grep -n '[[:blank:]]$$' $$(find . -type f -name "*.dd") ; test $$? -eq 1
622+
@echo "Executing assert_writeln_magic tests"
623+
$<
616624

617625
################################################################################
618626
# Changelog generation

0 commit comments

Comments
 (0)