Merge pull request #175 from CyberShadow/pull-20150911-145139

fix Issue 15031 - rdmd should force rebuild when --compiler changes
This commit is contained in:
H. S. Teoh 2015-09-11 08:01:04 -07:00
commit 44e843e8bd
2 changed files with 17 additions and 0 deletions

1
rdmd.d
View file

@ -392,6 +392,7 @@ private string getWorkPath(in string root, in string[] compilerFlags)
MD5 context;
context.start();
context.put(compiler.representation);
context.put(root.absolutePath().representation);
foreach (flag; compilerFlags)
{

View file

@ -321,6 +321,22 @@ void runTests()
mkdir(conflictDir);
res = execute([rdmdApp, compilerSwitch, "-of" ~ conflictDir, forceSrc]);
assert(res.status != 0, "-of set to a directory should fail");
/* rdmd should force rebuild when --compiler changes: https://issues.dlang.org/show_bug.cgi?id=15031 */
res = execute([rdmdApp, compilerSwitch, forceSrc]);
assert(res.status == 0, res.output);
assert(!res.output.canFind("compile_force_src"));
auto fullCompilerPath = environment["PATH"]
.splitter(pathSeparator)
.map!(dir => dir.buildPath(compiler ~ binExt))
.filter!exists
.front;
res = execute([rdmdApp, "--compiler=" ~ fullCompilerPath, forceSrc]);
assert(res.status == 0, res.output ~ "\nCan't run with --compiler=" ~ fullCompilerPath);
assert(res.output.canFind("compile_force_src"));
}
void runConcurrencyTest()