Skip to content

Commit

Permalink
rdmd_test: simplify flag for specifying default compiler
Browse files Browse the repository at this point in the history
Since it seems there are some use-cases where it is unavoidable to run
`rdmd_test` directly, it's nice if we can reduce the amount of typing
required to do so.

Besides the rdmd executable itself, the only other obligatory argument
to the test suite is the default compiler expected to be used by rdmd.
This patch shortens the long option to `--default-compiler` and allows
an equivalent single-character `-D` option, so that usage can now be of
the form:

    rdmd_test -D <default-compiler> <path-to-rdmd-executable>

The posix.mak and win32.mak makefiles have been updated accordingly.
  • Loading branch information
WebDrake committed Mar 22, 2018
1 parent cf1124a commit e7ba852
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ endif

test_rdmd: $(ROOT)/rdmd_test $(RDMD_TEST_EXECUTABLE)
$< $(RDMD_TEST_EXECUTABLE) -m$(MODEL) \
--rdmd-default-compiler=$(RDMD_TEST_DEFAULT_COMPILER) \
--default-compiler=$(RDMD_TEST_DEFAULT_COMPILER) \
--test-compilers=$(RDMD_TEST_COMPILERS) \
$(VERBOSE_RDMD_TEST_FLAGS)
$(DMD) $(DFLAGS) -unittest -main -run rdmd.d
Expand Down
2 changes: 1 addition & 1 deletion rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(string[] args)
string testCompilerList; // e.g. "ldmd2,gdmd" (comma-separated list of compiler names)

auto helpInfo = getopt(args,
"rdmd-default-compiler", "[REQUIRED] default D compiler used by rdmd executable", &defaultCompiler,
"D|default-compiler", "[REQUIRED] default D compiler used by rdmd executable", &defaultCompiler,
"concurrency", "whether to perform the concurrency test cases", &concurrencyTest,
"m|model", "architecture to run the tests for [32 or 64]", &model,
"test-compilers", "comma-separated list of D compilers to test with rdmd", &testCompilerList,
Expand Down
2 changes: 1 addition & 1 deletion win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $(ROOT)\rdmd_test.exe : rdmd_test.d
test_rdmd : $(ROOT)\rdmd_test.exe $(RDMD_TEST_EXECUTABLE)
$(ROOT)\rdmd_test.exe \
$(RDMD_TEST_EXECUTABLE) -m$(MODEL) -v \
--rdmd-default-compiler=$(RDMD_TEST_DEFAULT_COMPILER) \
--default-compiler=$(RDMD_TEST_DEFAULT_COMPILER) \
--test-compilers=$(RDMD_TEST_COMPILERS)

test : test_rdmd

0 comments on commit e7ba852

Please sign in to comment.