Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use multiple different test compilers when invoking rdmd_test from Travis CI #297

Merged
merged 3 commits into from
Feb 6, 2018
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
12 changes: 11 additions & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ DRUNTIME_PATH = ../druntime
PHOBOS_PATH = ../phobos
DUB=dub

RDMD_TEST_COMPILERS = $(abspath $(DMD))

VERBOSE_RDMD_TEST=0
Copy link
Member

Choose a reason for hiding this comment

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

That isn't strictly needed, but a good practice nevertheless.


ifeq ($(VERBOSE_RDMD_TEST), 1)
override VERBOSE_RDMD_TEST_FLAGS:=-v
endif

WITH_DOC = no
DOC = ../dlang.org

Expand Down Expand Up @@ -110,7 +118,9 @@ test_tests_extractor: $(ROOT)/tests_extractor
$< -i ./test/tests_extractor/iteration.d | diff - ./test/tests_extractor/iteration.d.ext

test_rdmd: $(ROOT)/rdmd_test $(ROOT)/rdmd
$< --compiler=$(abspath $(DMD)) -m$(MODEL)
$< --compiler=$(abspath $(DMD)) -m$(MODEL) \
--test-compilers=$(RDMD_TEST_COMPILERS) \
$(VERBOSE_RDMD_TEST_FLAGS)
$(DMD) $(DFLAGS) -unittest -main -run rdmd.d

test: test_tests_extractor test_rdmd
Expand Down
12 changes: 10 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@

set -uexo pipefail

make -f posix.mak all DMD="$(which $DMD)"
make -f posix.mak test DMD="$(which $DMD)"
~/dlang/install.sh install ldc

~/dlang/install.sh list

LDMD2=$(find ~/dlang -type f -name "ldmd2")
Copy link
Member

Choose a reason for hiding this comment

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

I think I should add a flag to the installer script that allows to get the binary path or main binary. What would be more useful?

  • --print-binary-dir
  • --print-dc
  • --print-dmd

Or maybe simply all three of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To my mind what would be most useful would be a way for list to list the full compiler paths rather than just the compiler names and versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i.e. to be able to do install.sh list --full-path or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wouldn't make any of these options a blocker or requirement for this PR, though. The find solution is crude, but it does work.


make -f posix.mak all DMD=$(which dmd)
make -f posix.mak test DMD=$(which dmd) \
RDMD_TEST_COMPILERS=dmd,$LDMD2 \
Copy link
Member

Choose a reason for hiding this comment

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

Always use quotes for variables ( I recommend the shellcheck linter)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were quick, I'd have fixed that :-P

Copy link
Member

Choose a reason for hiding this comment

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

Travis always uses the same paths as do we on the installer side, so it wasn't really blocking this PR ;-)
(And I generally prefer to avoid PRs getting stalled because of such tiny nits).
Thanks for the quick follow-up.

VERBOSE_RDMD_TEST=1