Skip to content

Commit

Permalink
Merge pull request #337 from marler8997/rdmdTestVerifyDefaultCompiler
Browse files Browse the repository at this point in the history
Verify default compiler in help text matches given default compiler
merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
  • Loading branch information
dlang-bot authored Mar 20, 2018
2 parents 15cc829 + 0aeb69a commit cf1124a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,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);
}

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

0 comments on commit cf1124a

Please sign in to comment.