Skip to content
Merged
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: 12 additions & 0 deletions rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ void runCompilerAgnosticTests(string rdmdApp, string defaultCompiler, string mod
assert(res.status == 0, res.output);
assert(res.output.canFind("Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]..."));

string helpText = res.output;

// verify help text matches expected defaultCompiler
{
enum compilerHelpLine = " --compiler=comp use the specified compiler (e.g. gdmd) instead of ";
auto offset = helpText.indexOf(compilerHelpLine);
assert(offset >= 0);
auto compilerInHelp = helpText[offset + compilerHelpLine.length .. $];
compilerInHelp = compilerInHelp[0 .. compilerInHelp.indexOf('\n')];
assert(defaultCompiler.baseName == compilerInHelp);
}

Choose a reason for hiding this comment

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

This is a nice additional test, thanks for adding it.

However, if you're thinking that it provides a path to (in future) removing the need for the --rdmd-default-compiler flag ... it won't. See remarks in the earlier PR about why that is.


// run the fallback compiler test (this involves
// searching for the default compiler, so cannot
// be run with other test compilers)
Expand Down