From 6747242c1a228782a71c0591fe3b1ea6fc09ef06 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Sun, 18 Mar 2018 20:36:09 -0600 Subject: [PATCH] support relative compiler filenames in rdmd_test --- posix.mak | 4 ++-- rdmd_test.d | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/posix.mak b/posix.mak index 05ddc85..5d7d228 100644 --- a/posix.mak +++ b/posix.mak @@ -99,7 +99,7 @@ clean: $(ROOT)/tests_extractor: tests_extractor.d mkdir -p $(ROOT) DFLAGS="$(DFLAGS)" $(DUB) build \ - --single $< --force --compiler=$(abspath $(DMD)) $(DUBFLAGS) \ + --single $< --force --compiler=$(DMD) $(DUBFLAGS) \ && mv ./tests_extractor $@ ################################################################################ @@ -110,7 +110,7 @@ test_tests_extractor: $(ROOT)/tests_extractor $< -i ./test/tests_extractor/ascii.d | diff - ./test/tests_extractor/ascii.d.ext $< -i ./test/tests_extractor/iteration.d | diff - ./test/tests_extractor/iteration.d.ext -RDMD_TEST_COMPILERS = $(abspath $(DMD)) +RDMD_TEST_COMPILERS = $(DMD) RDMD_TEST_EXECUTABLE = $(ROOT)/rdmd RDMD_TEST_DEFAULT_COMPILER = $(basename $(DMD)) diff --git a/rdmd_test.d b/rdmd_test.d index 1717ed2..9ab35af 100755 --- a/rdmd_test.d +++ b/rdmd_test.d @@ -103,6 +103,11 @@ void main(string[] args) // run the test suite for each specified test compiler foreach (testCompiler; testCompilerList.split(',')) { + // if compiler is a relative filename it must be converted + // to absolute because this test changes directories + if (testCompiler.canFind!isDirSeparator || testCompiler.exists) + testCompiler = buildNormalizedPath(testCompiler.absolutePath); + runTests(rdmdApp, testCompiler, model); if (concurrencyTest) runConcurrencyTest(rdmdApp, testCompiler, model);