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
19 changes: 16 additions & 3 deletions test/tools/unit_test_runner.d
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Params:
void writeCmdfile(string path, string runnerPath, string outputPath,
const string[] testFiles)
{
const commonFlags = [
auto flags = [
"-version=NoBackend",
"-version=GC",
"-version=NoMain",
Expand All @@ -239,13 +239,17 @@ void writeCmdfile(string path, string runnerPath, string outputPath,
"-I" ~ projectRootDir.buildPath("src"),
"-I" ~ unitTestDir,
"-i",
"-g",
"-main",
"-of" ~ outputPath,
"-m" ~ model
] ~ testFiles ~ runnerPath;

const flags = needsStrtold ? commonFlags ~ ("-L" ~ strtoldObjPath) : commonFlags;
if (needsStrtold)
flags ~= ("-L" ~ strtoldObjPath);

// older versions of Optlink causes: "Error 45: Too Much DEBUG Data for Old CodeView format"
if (!usesOptlink)
flags ~= "-g";

write(path, flags.join("\n"));
}
Expand Down Expand Up @@ -298,6 +302,15 @@ void buildStrtold()
enforce(spawnShell(cmd).wait() == 0, "Failed to execute command: " ~ cmd);
}

bool usesOptlink()
{
version (DigitalMars)
return os == "windows" && model == "32";

else
return false;
}

bool needsStrtold()
{
version (Windows)
Expand Down